github-actions[bot] opened issue #15128:
zip:
ZipArchive::extractaborts the process on a symlink entry with a large declared size
Details Package zipVersion 0.6.6Date 2026-10-22 Patched versions >=9.0.0
ZipArchive::extract()sizes the symlink-target buffer from the uncompressed
size declared in the central directory record, before reading a single byte of
entry data:let mut target = Vec::with_capacity(file.size() as usize);Both inputs are attacker-controlled.
ZipFile::size()returns
uncompressed_sizeverbatim from the central directory, widened to a fullu64
by a ZIP64 extended-information extra field, and 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
S_IFLNKbit of the external-attributes field.
Vec::with_capacity()is infallible: when the reservation is refused it calls
handle_alloc_error()and aborts the process. This is not a Rust panic. It is
not caught bycatch_unwind(), is unaffected bypanic = "unwind", and is not
contained by running the call on a worker thread.A 112-byte archive is sufficient. One
Storedentry flaggedS_IFLNKwith a
ZIP64 field declaringuncompressed_size = 2^62and a zero-byte payload makes
extract()fail with:memory allocation of 4611686018427387904 bytes failed Aborted (core dumped) # exit 134The declared value only needs to exceed the host's address space, not its RAM:
Vec::with_capacity()maps address space without touching pages, so resident
memory stays flat and the abort happens on the refused reservation itself. Under
aulimit -vcap or a memory-constrained container the threshold drops far
enough that a plain 32-bituncompressed_sizewith no ZIP64 field suffices.Applications that extract archives from untrusted input are affected on Unix and
Windows targets with default features and no special configuration: upload
handling, mail-attachment processing, package and artefact ingestion, backup
restore and container-image layer extraction. No confidentiality or integrity
property is affected: there is no memory unsafety, no out-of-bounds access, no
disclosure and no data corruption.The fix landed in zip-rs/zip2#984 and
shipped in 9.0.0.For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-q7v9-x93c-xqv3
See advisory page for additional details.
alexcrichton closed issue #15128:
zip:
ZipArchive::extractaborts the process on a symlink entry with a large declared size
Details Package zipVersion 0.6.6Date 2026-10-22 Patched versions >=9.0.0
ZipArchive::extract()sizes the symlink-target buffer from the uncompressed
size declared in the central directory record, before reading a single byte of
entry data:let mut target = Vec::with_capacity(file.size() as usize);Both inputs are attacker-controlled.
ZipFile::size()returns
uncompressed_sizeverbatim from the central directory, widened to a fullu64
by a ZIP64 extended-information extra field, and 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
S_IFLNKbit of the external-attributes field.
Vec::with_capacity()is infallible: when the reservation is refused it calls
handle_alloc_error()and aborts the process. This is not a Rust panic. It is
not caught bycatch_unwind(), is unaffected bypanic = "unwind", and is not
contained by running the call on a worker thread.A 112-byte archive is sufficient. One
Storedentry flaggedS_IFLNKwith a
ZIP64 field declaringuncompressed_size = 2^62and a zero-byte payload makes
extract()fail with:memory allocation of 4611686018427387904 bytes failed Aborted (core dumped) # exit 134The declared value only needs to exceed the host's address space, not its RAM:
Vec::with_capacity()maps address space without touching pages, so resident
memory stays flat and the abort happens on the refused reservation itself. Under
aulimit -vcap or a memory-constrained container the threshold drops far
enough that a plain 32-bituncompressed_sizewith no ZIP64 field suffices.Applications that extract archives from untrusted input are affected on Unix and
Windows targets with default features and no special configuration: upload
handling, mail-attachment processing, package and artefact ingestion, backup
restore and container-image layer extraction. No confidentiality or integrity
property is affected: there is no memory unsafety, no out-of-bounds access, no
disclosure and no data corruption.The fix landed in zip-rs/zip2#984 and
shipped in 9.0.0.For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-q7v9-x93c-xqv3
See advisory page for additional details.
alexcrichton commented on issue #15128:
Closing in favor of https://github.com/bytecodealliance/wasmtime/issues/14790
Last updated: Nov 19 2026 at 20:05 UTC