Skip to content
DayZeroHub
Medium Not yet writtenCVSS 6.1GHSA-qh76-45cr-8xrcCVE-2026-61725

CVE-2026-61725: sevenz-rust2: decompress builds each output path as dest.join(entry.name()) with no traversal guard, allowing a crafted .7z to write files outside the destination (Zip-Slip)

sevenz-rust2

Preliminary notice: published right away from the original source data, without editorial write-up. It will shortly be replaced by a written and reviewed version.

Summary

CVE-2026-61725: medium-severity vulnerability (CVSS 6.1) in sevenz-rust2.

What happened

Original description from the source: ### Summary Extracting an attacker-supplied 7z archive can write files outside the destination directory. The 7z header stores each entry's path as a UTF-16 name with nothing constraining it to a relative, in-tree path. The extractor joins that name onto the destination and writes to the result without normalizing it or checking that it stays under the destination root, so an entry named `../../etc/cron.d/x` or an absolute path escapes the target. ### Details In `src/util/decompress.rs`, `decompress_impl` computes the per-entry destination directly (line 140): ```rust let dest_path = dest.join(entry.name()); extract_fn(entry, reader, &dest_path) ``` `default_entry_extract_fn` (line 154) then acts on that path: ```rust let file = File::create(path) .map_err(|e| Error::file_open(e, path.to_string_lossy().to_string()))?; ``` There is no normalization, no `dest_path.starts_with(dest)` check, and no symlink-entry handling. `Path::join` discards the base when the joined component is absolute, and `..` components are not collapsed against the base. The convenience entry points (`decompress`, `decompress_file`, `decompress_with_password`, `decompress_file_with_password`) all route through `decompress_impl` with `default_entry_extract_fn`, so the default API is affected. The trust boundary is the archive bytes. Any caller that extracts an untrusted `.7z` reaches the sink. ### PoC 1. Build a `.7z` whose `FilesInfo` contains an entry named `../../../../tmp/pwned` (or, on Windows, an absolute path such as `C:\Windows\Temp\pwned`). 2. Call `sevenz_rust2::decompress_file("evil.7z", "./out")`. 3. The file is created at the traversed location outside `./out`. Targeting a startup/cron pa…

Why it matters

Medium severity, CVSS 6.1.

Affected products and versions

sevenz-rust2 < 0.21.1 (fixed in 0.21.1)

ProductVersionsFixed in
sevenz-rust2< 0.21.10.21.1

Action recommended by the source

Upgrade to a fixed version: 0.21.1.

Fixed in: 0.21.1

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-22, CWE-23

Relevant change history

  1. Published

    Preliminary advisory published.