Advisory

RUSTSEC-2026-0547

Also known as: CVE-2026-115907, GHSA-9hj8-73fh-9963

Summary

Legacy Shrink, Reduce and Implode decoders preallocate the declared uncompressed size

Details

With the legacy-zip feature, the decoders for the Shrink, Reduce and Implode compression methods reserved output capacity for the entry's declared uncompressed size before decoding anything. That size comes from the archive, and a ZIP64 entry can declare any 64-bit value, so reading or extracting a crafted entry of a few bytes panics with "capacity overflow" or fails a huge allocation.

An attacker who can supply an archive can stop a process that reads it, for example through ZipArchive::extract.

Only builds with the legacy-zip feature are affected; it is not enabled by default.

The fix caps the preallocation at 1 MiB, and such an entry now returns an error.

Severity

High Basis: CVSS v3 score 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2026-10-22 12:00 UTC
Modified
2026-11-17 10:15 UTC

Affected packages and fixes

zip

crates.io · All systems

Affected

  • introduced 5.1.0, fixed 9.0.0 (semver)

Fixed versions

9.0.0

Fix

  • Fixed version 9.0.0
    cargo update -p zip --precise 9.0.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences