Repository navigation
Update Rust crate zip to v9 - #29808
Conversation
|
Renovate only bumped us to 9.0.0, which was still vulnerable to the security issue (which doesn't seem to affect our internal usage), so I bumped to 9.0.5, the first fixed version, and updated to the new APIs. The latter meant I also bumped the fuzz lockfile, which included a bunch of other updates. |
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 98.60%. The percentage of expected errors that received a diagnostic held steady at 98.86%. The number of fully passing files held steady at 137/146. Results for 67bc046 · Workflow run |
Memory usage reportMemory usage unchanged ✅ Results for 67bc046 · Workflow run |
|
|
This PR contains the following updates:
8.0→9.0zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Arbitrary File Overwrite & RCE
CVE-2026-115905 / GHSA-m665-v7pm-7grj
More information
Details
Summary
A critical architectural parser differential exists in the
zipcrate (<= 9.0.4) between random-access archive readers (ZipArchive) and streaming readers (ZipStreamReader).ZipArchiveconsiders the Central Directory File Header (CDFH) authoritative and ignores the filename declared in the Local File Header (LFH). In contrast,ZipStreamReaderrelies exclusively on the Local File Header (LFH) when extracting files to the filesystem.This discrepancy enables ZIP archives to appear to have different file paths and contents according to which tool is reading them.
Details
Architectural Root Cause
In the PKWARE ZIP archive format, every file entry is defined in two distinct locations:
In
zip2:src/read/zip_archive.rs:ZipArchiveparses the central directory intoSharedBuilder.files. All file lookups by index or name read exclusively from the CDFH table, completely ignoring the filename present in the LFH.src/read/stream.rs:L86-L141:ZipStreamReader::visitandZipStreamReader::extractread sequentially from the stream without verifying the central directory index. Each entry is parsed viaread_zipfile_from_streamand written to disk using the unverified filename declared in the LFH:src/write.rs:L1552: The crate explicitly exposesshallow_copy_file, an API that constructs dual-header desynchronizations by adding a new CDFH entry with an alias name pointing to an existing file without updating the original LFH.Threat Scenario & Severity Justification (10.0 / 9.9 Critical)
doc_report.pdf(Clean document)cron_worker.sh(Malicious root backdoor)ZipArchive(or similar CDFH-first parsers), detects onlydoc_report.pdf, and approves the file.ZipStreamReader::extract.ZipStreamReaderreads the LFH and overwritescron_worker.sh.Proof of Concept
The following automated integration test reproducibly demonstrates the complete CVSS 10.0 / 9.9 exploit chain (Security Gateway Evasion -> Arbitrary File Overwrite -> RCE & DoS) against
zip2:Verified Test Execution Output
Impact
An attacker can construct a crafted archive whose Central Directory displays a benign filename (doc_report.pdf) that is inspected and approved by upstream security gateways (antivirus scanners, mail filters, upload firewalls), while automated backend ingestion pipelines or microservices using ZipStreamReader extract an arbitrary or malicious file (overwriting e.g. cron_worker.sh or critical system binaries). Because an adversary can overwrite existing files on disk, this vulnerability leads to Security Control Bypass, Arbitrary File Overwrite, Complete Denial of Service, and Remote Code Execution (RCE) in situations where a tool relying on the central directory trusts a tool that relied on the local file headers or vice-versa.
Who is Impacted:
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
zip-rs/zip2 (zip)
v9.0.5Compare Source
🐛 Bug Fixes
⚙️ Miscellaneous Tasks
v9.0.4Compare Source
🐛 Bug Fixes
Ok(None)when read_zipfile_from_stream is called on an empty archive (#1063)⚙️ Miscellaneous Tasks
v9.0.3Compare Source
🐛 Bug Fixes
v9.0.2Compare Source
🐛 Bug Fixes
v9.0.1Compare Source
🐛 Bug Fixes
v9.0.0Compare Source
🚀 Features
by_index_with_data_descriptor(#994)ZipWriter::hide_filefor in-place entry deletion (#924)aes_modetoaes_settings()in ZipFileData (#925)🐛 Bug Fixes
🚜 Refactor
ZipFileFlagsto wrapflags(#947)crate::formatwithzip::unstable::format(#944)format/functions.rs(#943)make_reader()function (#936)initialize_local_block(#934)write/options.rs(#931)⚙️ Miscellaneous Tasks
Fix
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.