CVE-2024-47877 Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.

Medium 6.9 Published Updated

A malicious archive can create symlinks outside the extraction directory, potentially leading to arbitrary file writes or code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-47877?

CVE-2024-47877 is a medium-severity path traversal vulnerability in codeclysm extract, published on 11 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Extract is aA Go library to extract archives in zip, tar.gz or tar.bz2 formats. A maliciously crafted archive may allow an attacker to create a symlink outside the extraction target directory. This vulnerability is fixed in 4.0.0. If you're using the Extractor.FS interface, then upgrading to /v4 will require to implement the new methods that have been added.

Weakness: CWE-61, CWE-22

Which versions are affected by CVE-2024-47877?

9 open source packages ship an affected version, including github.com/codeclysm/extract, github.com/codeclysm/extract/v3 and github.com/codeclysm/extract/v4. It affects 1 product.

PackageAffectedFixed in
github.com/codeclysm/extract GoAll versionsNone
github.com/codeclysm/extract GoAll versions to 2.2.0None
github.com/codeclysm/extract GoAll versions to 2.2.0None
github.com/codeclysm/extract/v3 GoAll versionsNone
github.com/codeclysm/extract/v3 GoAll versions to 3.1.1None
github.com/codeclysm/extract/v3 GoAll versions to 3.1.1None
3 more packages
github.com/codeclysm/extract/v4 GoAll versions4.0.0
github.com/codeclysm/extract/v4 GoAll versions4.0.0
github.com/codeclysm/extract/v4 GoAll versions4.0.0

Products include Codeclysm Extract.

How do I fix CVE-2024-47877?

Upgrade to a fixed version.

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

Is CVE-2024-47877 being exploited?

There is no known exploitation of CVE-2024-47877 in the wild and no public exploit code.

Sources

Also known as GHSA-8rm2-93mq-jqhc, GO-2024-3196.

Is CVE-2024-47877 in your software?

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

Check your SBOMs for free