`decompress`: tar-family extractors write archive entries without a path-traversal check (tar-slip)
Historical advisory saved 24 Oct 2026 13:19:54 UTC. The publisher may have updated it since then. Latest advisory.
osv · RUSTSEC-2026-0328
PublishedThe tar-family extractors in `decompress` (`.tar`, `.tar.gz`, `.tar.xz`, `.tar.bz2`, `.tar.zst`) build each output path from the **raw archive entry path** and write to it with no traversal check, so a malicious archive can write files **outside** the destination directory, a "tar-slip" / zip-slip path traversal (CWE-22 / CWE-23). In `src/decompressors/tar_common.rs` (`tar_extract`): ```rust let filepath = entry.path()?; // raw entry path let filepath = filepath.components().skip(opts.strip).collect::<PathBuf>(); // strips leading components only — keeps `..` let outpath = to.join(filepath); // ... let mut outfile = fs::File::create(&outpath)?; // writes anywhere ``` `.components().skip(opts.strip)` removes a fixed number of *leading* path components but leaves interior `..` components intact so an entry named e.g. `../../../../home/<user>/.bashrc`, or an absolute path, resolves **outside** `to`. This affects all platforms.
- Source published
- 19 Sep 2026 12:00:00 UTC
- Source modified
- 3 Oct 2026 07:30:03 UTC
- Saved here
- 24 Oct 2026 13:19:54 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.
CVSS_V3 · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H