RUSTSEC-2026-0245 Relative/Absolute Path Traversal (CWE-23/CWE-36) in `decompress_impl` that enables an arbitrary file write.

Not scored Published

A path traversal vulnerability in the sevenz-rust library allows attackers to write arbitrary files via malicious archives, potentially leading to code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is RUSTSEC-2026-0245?

RUSTSEC-2026-0245 is a path traversal vulnerability in sevenz-rust, published on 6 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Which versions are affected by RUSTSEC-2026-0245?

1 open source package ship an affected version, including sevenz-rust.

PackageAffectedFixed in
sevenz-rust crates.ioFrom 0.0.0-0None

How do I fix RUSTSEC-2026-0245?

No fix has been published for RUSTSEC-2026-0245 yet. Limit exposure of the affected software until one is available.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is RUSTSEC-2026-0245 being exploited?

There is no known exploitation of RUSTSEC-2026-0245 in the wild and no public exploit code.

Sources

Is RUSTSEC-2026-0245 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free