# RUSTSEC-2026-0328: `decompress`: tar-family extractors write archive entries without a path-traversal check (tar-slip)

- Severity: High 7.1 (CVSS:3.1, scored by RustSec Advisory Database) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-09-19T12:00:00.000Z
- Modified: 2026-10-03T07:30:03.083Z

## Description

The 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.

(As written by RustSec Advisory Database.)

## Affected

- decompress (crates.io): from 0.0.0-0

## References

- <https://crates.io/crates/decompress> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0328.html> (advisory)
- <https://github.com/rusty-ferris-club/decompress/issues/21> (report)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0328](https://rustsec.org/advisories/RUSTSEC-2026-0328.html), CC0-1.0, modified 2026-10-03

---

Page: https://cve.day/RUSTSEC-2026-0328 · Whole record: https://cve.day/RUSTSEC-2026-0328.json · Rebuilt by cve.day 2026-11-25T22:56:43.422Z
