CVE-2024-24579 Tar path traversal in stereoscope when processing OCI tar archives

Medium 5.3 Published Updated

Attackers can write files outside the intended directory by crafting malicious OCI tar archives processed by the stereoscope Go library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-24579?

CVE-2024-24579 is a medium-severity path traversal vulnerability in anchore stereoscope, published on 31 Jan 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-22

Which versions are affected by CVE-2024-24579?

3 open source packages ship an affected version, including github.com/anchore/stereoscope. It affects 1 product.

PackageAffectedFixed in
github.com/anchore/stereoscope GoAll versions0.0.1
github.com/anchore/stereoscope GoAll versions0.0.1
github.com/anchore/stereoscope GoAll versions0.0.1

Products include Anchore Stereoscope.

How do I fix CVE-2024-24579?

Upgrade github.com/anchore/stereoscope to 0.0.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-24579 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24579 exists.

Sources

Also known as GHSA-hpxr-w9w7-g4gv, GO-2024-2490, MINI-3rf8-prxq-hcfv, MINI-4598-v2p2-mw76, MINI-4m3g-8fch-6g2m, MINI-8qj4-cg4m-x5jw and 2 more.

Is CVE-2024-24579 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free