CVE-2026-33056: Tar Tar-rs `unpack_in` Can Chmod Arbitrary Vulnerability
MODERATECVE-2026-33056 is a MODERATE (CVSS 6.5) tar-rs `unpack_in` can chmod arbitrary vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Tar libraries in the crates.io ecosystem. The issue involves tar-rs `unpack_in` can chmod arbitrary directories by following symlinks. Remediation is available by upgrading affected packages to version 0.4.45.
CVE-2026-33056 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-33056
To remediate this vulnerability, upgrade all affected Tar dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade tar to 0.4.45
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for tar
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-33056, inspect your project dependencies for Tar:
inspect dependencies for tar
Analyze the terminal output to locate any version of Tar in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.45), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Tar, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33056 Affected Tar Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tar
|
crates.io |
< 0.4.45
|
0.4.45
|
References
Frequently Asked Questions
What is CVE-2026-33056?
Which Tar versions are affected?
What version fixes CVE-2026-33056?
Is tar affected?
What is the CVSS score of CVE-2026-33056?
What CWE is associated with CVE-2026-33056?
How can I check crates.io dependencies for CVE-2026-33056?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j4xf-2g29-59ph",
"modified" : "2026-03-25T18:36:33Z",
"published" : "2026-03-20T17:25:09Z",
"aliases" : [ "CVE-2026-33056" ],
"summary" : "tar-rs `unpack_in` can chmod arbitrary directories by following symlinks",
"details" : "## Summary\n\nWhen 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.\n\n## Reproducer\n\nA 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.\n\n## Fix \n\nThe fix is very simple, we now use `fs::symlink_metadata()` in `unpack_dir`, so symlinks are detected and rejected rather than followed.\n\n## Credit\n\nThis issue was reported by @xokdvium - thank you!",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "tar"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.45"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.4.44"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/alexcrichton/tar-rs/security/advisories/GHSA-j4xf-2g29-59ph"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33056"
}, {
"type" : "WEB",
"url" : "https://github.com/alexcrichton/tar-rs/commit/17b1fd84e632071cb8eef9d3709bf347bd266446"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/alexcrichton/tar-rs"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2026-0067.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-61" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-20T17:25:09Z",
"nvd_published_at" : "2026-03-20T08:16:11Z"
}
}