CVE-2026-33056 — Vulnerability in tar — CVE Details
tar-rs `unpack_in` can chmod arbitrary directories by following symlinks
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.50%). Schedule for your next planned update.
Does your project use an affected tar version?
Paste your Cargo.lock to check it for CVE-2026-33056 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
When unpacking a tar archive, the tar crate's unpack_dir function uses fs::metadata() to check whether a path that already exists is a directory. Because fs::metadata() follows symbolic links, a crafted tarball containing a symlink entry followed by a directory entry with the same name causes the crate to treat the symlink target as a valid existing directory — and subsequently apply chmod to it. This allows an attacker to modify the permissions of arbitrary directories outside the extraction root.
Reproducer
A malicious tarball contains two entries: (1) a symlink foo pointing to an arbitrary external directory, and (2) a directory entry foo/. (or just foo). When unpacked, create_dir("foo") fails with EEXIST because the symlink is already on disk. The fs::metadata() check then follows the symlink, sees a directory at the target, and allows processing to continue. The directory entry's mode bits are then applied via chmod, which also follows the symlink — modifying the permissions of the external target directory.
Fix
The fix is very simple, we now use fs::symlink_metadata() in unpack_dir, so symlinks are detected and rejected rather than followed.
Credit
This issue was reported by @xokdvium - thank you!
Advisory Timeline
- First published March 20, 2026 (251 days ago).
- Last revised September 10, 2026 — 173 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p tar --precise 0.4.45
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| tar crates.io · Affected: All versions | 0.4.45 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-61
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
References
- https://github.com/alexcrichton/tar-rs/security/advisories/GHSA-j4xf-2g29-59phWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-33056ADVISORY
- https://github.com/alexcrichton/tar-rs/commit/17b1fd84e632071cb8eef9d3709bf347bd266446WEB
- https://github.com/alexcrichton/tar-rsPACKAGE
- https://rustsec.org/advisories/RUSTSEC-2026-0067.htmlWEB
Frequently Asked Questions
- What is CVE-2026-33056?
- tar-rs `unpack_in` can chmod arbitrary directories by following symlinks. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.5/10).
- How do I check if my project is affected by CVE-2026-33056?
- CVE-2026-33056 affects tar. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-33056 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 35.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2018-20990HIGH
Links in archives can overwrite any existing file
- CVE-2021-38511HIGH
Links in archive can create arbitrary directories
- CVE-2026-115906MEDIUM
zip: AES Entry HMAC Authentication Bypass on Premature EOF
- CVE-2026-35374MEDIUM
split: TOCTOU output-open allows truncating a swapped file
- CVE-2026-33055MEDIUM
tar-rs incorrectly ignores PAX size headers if header size is nonzero