CVE-2026-61725: sevenz-rust2 Decompress Builds Each Output Path Vulnerability

MODERATE
Advisory Identifier: GHSA-qh76-45cr-8xrc
CVSS 6.1
CWE-23 CWE-22
Published
Advisory Summary

CVE-2026-61725 is a MODERATE (CVSS 6.1) decompress builds each output path vulnerability (CWE-23: Relative Path Traversal) affecting sevenz-rust2 libraries in the crates.io ecosystem. The issue involves 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). Remediation is available by upgrading affected packages to version 0.21.1.

CVE-2026-61725 at a Glance

CVE Identifier CVE-2026-61725
GHSA Identifier GHSA-qh76-45cr-8xrc
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-23: Relative Path Traversal
Affected Product sevenz-rust2
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-61725

To remediate this vulnerability, upgrade all affected sevenz-rust2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sevenz-rust2 fixed: 0.21.1
Upgrade sevenz-rust2 to 0.21.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sevenz-rust2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-61725, inspect your project dependencies for sevenz-rust2:

inspect dependencies for sevenz-rust2

Analyze the terminal output to locate any version of sevenz-rust2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In sevenz-rust2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 path or a config file turns the write into code execution or persistence. ### Impact Arbitrary file write outside the intended directory (CWE-22 / CWE-23, the Zip-Slip class). On extraction of an attacker-controlled archive, an entry overwrites files outside the destination — config, cron, autostart, or build artifacts — which can escalate to code execution. Reachable by upload-handling backends, malware-analysis sandboxes, mod/game installers, and CI steps that unpack user-supplied 7z files. ### Suggested remediation Reject any entry whose name contains a `ParentDir`, `RootDir`, or `Prefix` component, or canonicalize the joined path and verify `starts_with(dest)` before creating it. Apply the guard inside `default_entry_extract_fn` (and `decompress_impl`) so the hardening is the default rather than left to each caller. Reject or explicitly opt-in symlink entries. ## Maintainer response This issue was patched with ef760b61f3535ac8b93006212aef41bfebc237eb and released as `v0.21.1` to crates.io Consumers that extract attacker-supplied archives received over a network without user interaction should re-score as AV:N/UI:N (≈8.6).

CVE-2026-61725 Affected sevenz-rust2 Versions

1 component(s)
Fixed Versions:
0.21.1
Product / Package Ecosystem Affected Versions Fixed Version
sevenz-rust2
crates.io
< 0.21.1
0.21.1

References

Frequently Asked Questions

What is CVE-2026-61725?
CVE-2026-61725 is a security vulnerability in sevenz-rust2 involving 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) under CWE-23: Relative Path Traversal.
Which sevenz-rust2 versions are affected?
Affected versions include releases prior to 0.21.1 across affected packages: sevenz-rust2.
What version fixes CVE-2026-61725?
Upgrading to 0.21.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sevenz-rust2 affected?
Yes, sevenz-rust2 is affected in releases prior to 0.21.1. Upgrade your dependency to 0.21.1 or later.
What is the CVSS score of CVE-2026-61725?
CVE-2026-61725 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L.
What CWE is associated with CVE-2026-61725?
CVE-2026-61725 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check crates.io dependencies for CVE-2026-61725?
Run the dependency tree command: 'inspect dependencies for sevenz-rust2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qh76-45cr-8xrc",
  "modified" : "2026-11-20T23:33:15Z",
  "published" : "2026-11-20T23:33:14Z",
  "aliases" : [ "CVE-2026-61725" ],
  "summary" : "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)",
  "details" : "### Summary\n\nExtracting 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.\n\n### Details\n\nIn `src/util/decompress.rs`, `decompress_impl` computes the per-entry destination directly (line 140):\n\n```rust\nlet dest_path = dest.join(entry.name());\nextract_fn(entry, reader, &dest_path)\n```\n\n`default_entry_extract_fn` (line 154) then acts on that path:\n\n```rust\nlet file = File::create(path)\n    .map_err(|e| Error::file_open(e, path.to_string_lossy().to_string()))?;\n```\n\nThere 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.\n\nThe trust boundary is the archive bytes. Any caller that extracts an untrusted `.7z` reaches the sink.\n\n### PoC\n\n1. Build a `.7z` whose `FilesInfo` contains an entry named `../../../../tmp/pwned` (or, on Windows, an absolute path such as `C:\\Windows\\Temp\\pwned`).\n2. Call `sevenz_rust2::decompress_file(\"evil.7z\", \"./out\")`.\n3. The file is created at the traversed location outside `./out`. Targeting a startup/cron path or a config file turns the write into code execution or persistence.\n\n### Impact\n\nArbitrary file write outside the intended directory (CWE-22 / CWE-23, the Zip-Slip class). On extraction of an attacker-controlled archive, an entry overwrites files outside the destination — config, cron, autostart, or build artifacts — which can escalate to code execution. Reachable by upload-handling backends, malware-analysis sandboxes, mod/game installers, and CI steps that unpack user-supplied 7z files.\n\n### Suggested remediation\n\nReject any entry whose name contains a `ParentDir`, `RootDir`, or `Prefix` component, or canonicalize the joined path and verify `starts_with(dest)` before creating it. Apply the guard inside `default_entry_extract_fn` (and `decompress_impl`) so the hardening is the default rather than left to each caller. Reject or explicitly opt-in symlink entries.\n\n## Maintainer response\n\nThis issue was patched with ef760b61f3535ac8b93006212aef41bfebc237eb and released as `v0.21.1` to crates.io\n\nConsumers that extract attacker-supplied archives received over a network without user interaction should re-score as AV:N/UI:N (≈8.6).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "sevenz-rust2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.21.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hasenbanck/sevenz-rust2/security/advisories/GHSA-qh76-45cr-8xrc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-61725"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hasenbanck/sevenz-rust2/commit/ef760b61f3535ac8b93006212aef41bfebc237eb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hasenbanck/sevenz-rust2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-20T23:33:14Z",
    "nvd_published_at" : "2026-10-30T23:17:11Z"
  }
}