{"id":"RUSTSEC-2026-0328","aliases":["RUSTSEC-2026-0328"],"related":[],"kind":"vulnerability","state":"published","title":"`decompress`: tar-family extractors write archive entries without a path-traversal check (tar-slip)","summary":"The tar-family extractors in `decompress` (`.tar`, `.tar.gz`, `.tar.xz`,\n`.tar.bz2`, `.tar.zst`) build each output path from the **raw archive entry path**\nand write to it with no traversal check, so a malicious archive can write files\n**outside** the destination directory, a \"tar-slip\" / zip-slip path traversal\n(CWE-22 / CWE-23).\n\nIn `src/decompressors/tar_common.rs` (`tar_extract`):\n\n```rust\nlet filepath = entry.path()?;                                    // raw entry path\nlet filepath = filepath.components().skip(opts.strip).collect::<PathBuf>();\n                                     // strips leading components only — keeps `..`\nlet outpath = to.join(filepath);\n// ...\nlet mut outfile = fs::File::create(&outpath)?;                   // writes anywhere\n```\n\n`.components().skip(opts.strip)` removes a fixed number of *leading* path\ncomponents but leaves interior `..` components intact so an entry named \ne.g. `../../../../home/<user>/.bashrc`, or an absolute path, resolves **outside** \n`to`. This affects all platforms.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"The tar-family extractors in `decompress` (`.tar`, `.tar.gz`, `.tar.xz`,\n`.tar.bz2`, `.tar.zst`) build each output path from the **raw archive entry path**\nand write to it with no traversal check, so a malicious archive can write files\n**outside** the destination directory, a \"tar-slip\" / zip-slip path traversal\n(CWE-22 / CWE-23).\n\nIn `src/decompressors/tar_common.rs` (`tar_extract`):\n\n```rust\nlet filepath = entry.path()?;                                    // raw entry path\nlet filepath = filepath.components().skip(opts.strip).collect::<PathBuf>();\n                                     // strips leading components only — keeps `..`\nlet outpath = to.join(filepath);\n// ...\nlet mut outfile = fs::File::create(&outpath)?;                   // writes anywhere\n```\n\n`.components().skip(opts.strip)` removes a fixed number of *leading* path\ncomponents but leaves interior `..` components intact so an entry named \ne.g. `../../../../home/<user>/.bashrc`, or an absolute path, resolves **outside** \n`to`. This affects all platforms.","format":"markdown","source":"rustsec"}],"published":"2026-09-19T12:00:00.000Z","modified":"2026-10-03T07:30:03.083Z","severity":{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H","score":7.1,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"decompress","purl":"pkg:cargo/decompress","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/decompress","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0328.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/rusty-ferris-club/decompress/issues/21","tags":["report"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0328","url":"https://rustsec.org/advisories/RUSTSEC-2026-0328.html","licence":"CC0-1.0","modified":"2026-10-03T07:30:03.083Z"}],"updatedAt":"2026-11-25T22:56:43.422Z"}