{"id":"CVE-2026-61725","kind":"vulnerability","aliases":["CVE-2026-61725"],"related":[],"title":"sevenz-rust2: crafted 7z archive writes files outside extraction directory","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.","summary":"sevenz-rust2 is a Rust library for reading and writing 7z archives. A crafted archive with parent-directory or absolute entry names can write or overwrite files anywhere the extracting process can reach, which can lead to code execution through config, startup, cron or build files.","severity":"medium","cvss":6.1,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["cargo","file-upload","package","rust","sevenz-rust2"],"not_affected_if":["archives-trusted-only","no-7z-extraction","version-0.21.1-or-later"],"how_to_check":"- Check the locked version of `sevenz-rust2` in `Cargo.lock` (for example `grep -A1 'name = \"sevenz-rust2\"' Cargo.lock`).\n- Search the codebase for calls to `decompress`, `decompress_file`, `decompress_with_password` or `decompress_file_with_password` from `sevenz-rust2`, especially on uploaded or untrusted archives.","fix":"- `sevenz-rust2` `0.21.1` or later.","status":"open","published_at":"2026-10-30T23:17:11+00:00","first_seen_at":"2026-10-30T23:26:12+00:00","triaged_at":"2026-10-30T23:28:10+00:00","updated_at":"2026-10-30T23:28:10+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-30T23:28:10Z","model":"claude-haiku-5-5","output":{"fix":"- `sevenz-rust2` `0.21.1` or later.","reach":"unknown","title":"sevenz-rust2: crafted 7z archive writes files outside extraction directory","impact":"high","summary":"sevenz-rust2 is a Rust library for reading and writing 7z archives. A crafted archive with parent-directory or absolute entry names can write or overwrite files anywhere the extracting process can reach, which can lead to code execution through config, startup, cron or build files.","audience":"developers","category":"package","nicknames":[],"who_cares":["rust","sevenz-rust2","cargo","file-upload"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"attacker overwrites files outside the target directory, enabling code execution","analyst_note":"","how_to_check":"- Check the locked version of `sevenz-rust2` in `Cargo.lock` (for example `grep -A1 'name = \"sevenz-rust2\"' Cargo.lock`).\n- Search the codebase for calls to `decompress`, `decompress_file`, `decompress_with_password` or `decompress_file_with_password` from `sevenz-rust2`, especially on uploaded or untrusted archives.","plain_action":"","needs_analyst":false,"not_affected_if":["archives-trusted-only","no-7z-extraction","version-0.21.1-or-later"],"who_is_affected":"Applications written in Rust that depend on sevenz-rust2 and extract 7z archives, particularly those that unpack uploaded or otherwise untrusted archives with the default convenience functions. Programs that only create archives or that only extract archives they produced themselves are not exposed by this flaw.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"medium"},"cost_usd":0.000746,"input_tokens":4360,"output_tokens":619,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-16':123C '-2026':13A,16A '-61725':14A,17A '0.21.1':90C,222C '7z':5A,38B,83C,96C 'absolut':48B,150C 'anywher':56B 'applic':207C 'archiv':6A,39B,42B,97C,120C,196C,215C 'attack':94C,201C 'attacker-control':200C 'attacker-suppli':93C 'automat':209C 'boundari':204C 'build':73B,186C 'byte':197C 'cargo':18B 'code':66B,191C 'compon':143C 'compressor':84C 'comput':111C 'config':69B 'configur':182C 'contain':128C 'control':202C 'conveni':161C 'craft':4A,41B 'creat':139C 'cron':71B,184C 'cve':12A,15A 'decompress':86C,109C,164C,165C,167C,171C 'default':130C,178C 'dest.join':115C 'destin':105C,113C,158C 'directori':11A,46B,106C,142C 'discard':156C 'entir':159C 'entri':49B,124C,131C,151C,162C 'entry.name':116C 'escap':144C 'execut':67B,192C 'extract':10A,58B,91C,132C,146C 'file':8A,20B,55B,74B,102C,138C,166C,172C,187C 'file-upload':19B 'fix':219C 'fn':133C 'impl':110C 'includ':205C 'issu':217C 'join':155C 'lead':64B,189C 'librari':33B 'make':153C 'name':50B,125C 'nativ':82C 'normal':118C 'otherwis':213C 'outsid':9A,103C 'overwrit':54B,101C,180C 'packag':22B 'parent':45B,141C 'parent-directori':44B,140C 'password':169C,174C 'path':152C,179C 'persist':194C 'point':163C 'prior':88C 'process':59B 'reach':61B 'read':35B 'root':147C 'rust':23B,32B,81C 'rust-nat':80C 'rust2':3A,26B,29B,77C 'sevenz':2A,25B,28B,76C 'sevenz-rust2':1A,24B,27B,75C 'src/util/decompress.rs':108C 'startup':70B,183C 'suppli':95C 'trust':203C 'unpack':210C 'untrust':214C 'upload':21B,211C 'use':176C 'utf':122C 'verifi':127C 'version':221C 'without':117C 'writabl':181C 'write':7A,37B,52B,99C,134C","nicknames":[],"mitigations":[],"who_affected":"Applications written in Rust that depend on sevenz-rust2 and extract 7z archives, particularly those that unpack uploaded or otherwise untrusted archives with the default convenience functions. Programs that only create archives or that only extract archives they produced themselves are not exposed by this flaw.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"first_public_at":"2026-10-30T23:17:11+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","cvss_by":"security-advisories@github.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-61725","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61725","severity":null,"published_at":"2026-10-30T23:17:11+00:00","modified_at":"2026-10-30T23:17:11+00:00","first_seen_at":"2026-10-30T23:26:12+00:00","fetched_at":"2026-10-30T23:26:12+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}