CVE-2021-38511 Links in archive can create arbitrary directories
Attackers can create arbitrary directories outside the intended extraction path by using symlinks in TAR archives, affecting Rust applications using the tar crate.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-38511?
CVE-2021-38511 is a high-severity path traversal vulnerability in n/a, published on 10 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
An issue was discovered in the tar crate before 0.4.36 for Rust. When symlinks are present in a TAR archive, extraction can create arbitrary directories via .. traversal.
Weakness: CWE-59
Which versions are affected by CVE-2021-38511?
3 open source packages ship an affected version, including tar. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
tar crates.io | All versions | 0.4.36 |
tar crates.io | All versions | 0.4.36 |
tar crates.io | From 0.0.0-0 | 0.4.36 |
Products include Tar Project Tar.
How do I fix CVE-2021-38511?
Upgrade tar to 0.4.36 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2021-38511 being exploited?
There is no known exploitation of CVE-2021-38511 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as DEBIAN-CVE-2021-38511, GHSA-62jx-8vmh-4mcw, RUSTSEC-2021-0080, UBUNTU-CVE-2021-38511.