rustsec-2026-0245
Vulnerability from osv_rustsec
Summary
All versions of sevenz-rust fail to validate file paths when extracting in decompress_impl (the underlying function used in the exposed decompress api functions).
This oversight allows a maliciously crafted archive to extract outside the extraction directory, from both relative paths such as ../../../... or absolute paths like C:\\... or /etc/..., which could lead to file disclosure or remote command execution in combination with other flaws or social engineering.
Details
The following line numbers will be referencing the latest version v0.6.1. The specific point of failure is at de_funcs.rs::101 inside decompress_impl.
seven.for_each_entries(|entry, reader| {
let dest_path = dest.join(entry.name());
extract_fn(entry, reader, &dest_path)
})?;
When the function iterates through each entry, it blindly joins the entry name with the output directory before passing the path into extract_fn, default_entry_extract_fn unless specified otherwise by user. This allows for relative path traversal from simple path concatenation and absolute path traversal due to std::path::join's edge case where if the "[passed] path is absolute, it replaces the current path."
default_entry_extract_fn also fails to validate if the entry it is given has a safe extraction path before it writes to disk at de_funcs.rs::135.
Status
The project has been abandoned and the repository has been deleted, so no upstream fix is expected. Users should migrate away from the library in favor of a modern up-to-date 7z library such as sevenz-rust2.
| URL | Type | |
|---|---|---|
{
"affected": [
{
"database_specific": {
"categories": [
"file-disclosure"
],
"cvss": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:H/SI:H/SA:H",
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "sevenz-rust",
"purl": "pkg:cargo/sevenz-rust"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0-0"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [],
"database_specific": {
"license": "CC0-1.0"
},
"details": "## Summary\n\nAll versions of `sevenz-rust` fail to validate file paths when extracting in `decompress_impl` (the underlying function used in the exposed decompress api functions). \n\nThis oversight allows a maliciously crafted archive to extract outside the extraction directory, from both relative paths such as `../../../...` or absolute paths like `C:\\\\...` or `/etc/...`, which could lead to file disclosure or remote command execution in combination with other flaws or social engineering.\n\n## Details\n\nThe following line numbers will be referencing the latest version v0.6.1. The specific point of failure is at `de_funcs.rs::101` inside `decompress_impl`.\n``` rust\nseven.for_each_entries(|entry, reader| {\n let dest_path = dest.join(entry.name());\n extract_fn(entry, reader, \u0026dest_path)\n})?;\n```\nWhen the function iterates through each entry, it blindly joins the entry name with the output directory before passing the path into `extract_fn`, `default_entry_extract_fn` unless specified otherwise by user. This allows for relative path traversal from simple path concatenation and absolute path traversal due to [std::path::join](https://doc.rust-lang.org/std/path/struct.Path.html#method.join)\u0027s edge case where if the \"[passed] path is absolute, it replaces the current path.\"\n\n`default_entry_extract_fn` also fails to validate if the entry it is given has a safe extraction path before it writes to disk at `de_funcs.rs::135`. \n\n## Status\n\nThe project has been abandoned and the repository has been deleted, so no upstream fix is expected. Users should migrate away from the library in favor of a modern up-to-date 7z library such as `sevenz-rust2`.",
"id": "RUSTSEC-2026-0245",
"modified": "2026-08-10T06:16:10Z",
"published": "2026-08-06T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/sevenz-rust"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0245.html"
}
],
"related": [],
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:H/SI:H/SA:H",
"type": "CVSS_V4"
}
],
"summary": "Relative/Absolute Path Traversal (CWE-23/CWE-36) in `decompress_impl` that enables an arbitrary file write."
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.