CVE-2024-24579
JSON

5.3medium

Tar path traversal in stereoscope when processing OCI tar archives

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.39% (higher than 35% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hpxr-w9w7-g4gvGO-2024-2490

Description

stereoscope is a go library for processing container images and simulating a squash filesystem. Prior to version 0.0.1, it is possible to craft an OCI tar archive that, when stereoscope attempts to unarchive the contents, will result in writing to paths outside of the unarchive temporary directory. Specifically, use of `github.com/anchore/stereoscope/pkg/file.UntarToDirectory()` function, the `github.com/anchore/stereoscope/pkg/image/oci.TarballImageProvider` struct, or the higher level `github.com/anchore/stereoscope/pkg/image.Image.Read()` function express this vulnerability. As a workaround, if you are using the OCI archive as input into stereoscope then you can switch to using an OCI layout by unarchiving the tar archive and provide the unarchived directory to stereoscope.

Affected

Product or packageVersionsReported by
anchore stereoscope< 0.0.1, before 0.0.1CVE List, NVD
github.com/anchore/stereoscope (Go)before 0.0.1GitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

stereoscope is a go library for processing container images and simulating a squash filesystem. Prior to version 0.0.1, it is possible to craft an OCI tar archive that, when stereoscope attempts to unarchive the contents, will result in writing to paths outside of the unarchive temporary directory. Specifically, use of `github.com/anchore/stereoscope/pkg/file.UntarToDirectory()` function, the `github.com/anchore/stereoscope/pkg/image/oci.TarballImageProvider` struct, or the higher level `github.com/anchore/stereoscope/pkg/image.Image.Read()` function express this vulnerability. As a workaround, if you are using the OCI archive as input into stereoscope then you can switch to using an OCI layout by unarchiving the tar archive and provide the unarchived directory to stereoscope.

GitHub Advisory Database
Impact

It is possible to craft an OCI tar archive that, when stereoscope attempts to unarchive the contents, will result in writing to paths outside of the unarchive temporary directory. Specifically, use of github.com/anchore/stereoscope/pkg/file.UntarToDirectory() function, the github.com/anchore/stereoscope/pkg/image/oci.TarballImageProvider struct, or the higher level github.com/anchore/stereoscope/pkg/image.Image.Read() function express this vulnerability.

Patches

Patched in v0.0.1

Workarounds

If you are using the OCI archive as input into stereoscope then you can switch to using an OCI layout by unarchiving the tar archive and provide the unarchived directory to stereoscope.

References
Go Vulnerability Database

It is possible to craft an OCI tar archive that, when stereoscope attempts to unarchive the contents, will result in writing to paths outside of the unarchive temporary directory.

NVD (es)

stereoscope es una liibrería para procesar imágenes de contenedores y simular un sistema de archivos squash. Antes de la versión 0.0.1, era posible crear un archivo tar OCI que, cuando stereoscope intenta desarchivar el contenido, se escribiría en rutas fuera del directorio temporal de desarchivado. Específicamente, el uso de la función `github.com/anchore/stereoscope/pkg/file.UntarToDirectory()`, la estructura `github.com/anchore/stereoscope/pkg/image/oci.TarballImageProvider` o el nivel superior `github. com/anchore/stereoscope/pkg/image.Image.Read()` expresa esta vulnerabilidad. Como workaround, si está utilizando el archivo OCI como entrada en el estereoscopio, puede pasar a utilizar un diseño OCI desarchivando el archivo tar y proporcionando el directorio desarchivado al estereoscopio.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2024-24579 changed 2024-08-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-hpxr-w9w7-g4gv changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-2490 changed 2026-02-04CC-BY-4.0
NVDCVE-2024-24579 changed 2026-06-17Public domain