CVE-2024-47877 Extract has insufficient checks allowing attacker to create symlinks outside the extraction directory.
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
github.com/codeclysm/extract Go | All versions | None |
github.com/codeclysm/extract Go | All versions to 2.2.0 | None |
github.com/codeclysm/extract Go | All versions to 2.2.0 | None |
github.com/codeclysm/extract/v3 Go | All versions | None |
github.com/codeclysm/extract/v3 Go | All versions to 3.1.1 | None |
github.com/codeclysm/extract/v3 Go | All versions to 3.1.1 | None |
3 more packages
github.com/codeclysm/extract/v4 Go | All versions | 4.0.0 |
github.com/codeclysm/extract/v4 Go | All versions | 4.0.0 |
github.com/codeclysm/extract/v4 Go | All versions | 4.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.