{"id":"RUSTSEC-2026-0067","summary":"`unpack_in` can chmod arbitrary directories by following symlinks","details":"In versions 0.4.44 and below of tar-rs, when unpacking a tar archive, the tar\ncrate's `unpack_dir` function uses [`fs::metadata()`][fs-metadata] to check\nwhether a path that already exists is a directory. Because `fs::metadata()`\nfollows symbolic links, a crafted tarball containing a symlink entry followed\nby a directory entry with the same name causes the crate to treat the symlink\ntarget as a valid existing directory — and subsequently apply chmod to it. This\nallows an attacker to modify the permissions of arbitrary directories outside\nthe extraction root.\n\nThis issue has been fixed in version 0.4.45.\n\n[fs-metadata]: https://doc.rust-lang.org/std/fs/fn.metadata.html","aliases":["CVE-2026-33056","GHSA-j4xf-2g29-59ph"],"modified":"2026-03-23T09:45:06.946281Z","published":"2026-03-19T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/tar"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0067.html"}],"affected":[{"package":{"name":"tar","ecosystem":"crates.io","purl":"pkg:cargo/tar"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.4.45"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"os":[],"functions":["tar::Entry::unpack","tar::Entry::unpack_in"]}},"database_specific":{"cvss":"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","informational":null,"categories":[],"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0067.json"}}],"schema_version":"1.7.5","severity":[{"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"}]}