Skip to main content
← All vulnerabilities
CVE-2026-61725

sevenz-rust2: unchecked 7z entry paths permit traversal and absolute-path file overwrites

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Fix
Fixed in 0.21.1
None on Exploit-DB, Metasploit or GitHub

Summary

The sevenz-rust2 Rust library, which compresses and extracts 7z archives, is affected. When an application extracts a maliciously crafted 7z archive, files can be written or overwritten outside the intended destination folder, potentially including configuration, startup, or build files that could lead to code execution or persistence.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

sevenz-rust2 is a Rust-native 7z compressor and `decompress`or. Prior to 0.21.1, extracting an attacker-supplied 7z archive can write or overwrite files outside the destination directory. In `src/util/decompress.rs`, `decompress_impl` computes each destination with `dest.join(entry.name())` without normalizing the archive's UTF-16 entry name or verifying containment, and `default_entry_extract_fn` writes to it with `File::create`. Parent-directory components escape the extraction root, and an absolute entry path makes the join discard the destination entirely. The convenience entry points `decompress`, `decompress_file`, `decompress_with_password`, and `decompress_file_with_password` all use this default path. Overwriting writable configuration, startup, cron, or build files can lead to code execution or persistence. The archive bytes are the attacker-controlled trust boundary, including for applications that automatically unpack uploaded or otherwise untrusted archives. This issue is fixed in version 0.21.1.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • hasenbanck sevenz-rust2

    fixed in 0.21.1

References 2

GitHub · hasenbanck/sevenz-rust2

FAQ

Questions about CVE-2026-61725

What does this mean?

sevenz-rust2 does not check the paths of entries in 7z archives, so an archive can name files outside the intended extraction directory, including absolute paths. The advisory says this can overwrite config, cron, autostart or build files and can escalate to code execution.Source: github.com

Am I affected, and how do I check?

The fixed range lists versions before 0.21.1 of the sevenz-rust2 crate. No specific setup conditions are listed. To check a project, look at the sevenz-rust2 version in Cargo.lock or in the output of cargo tree.Source: github.com

What should I do about it?

Upgrade sevenz-rust2 to 0.21.1 or later, the crates.io release that includes commit ef760b6.Source: github.com

Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data