{"id":"RUSTSEC-2026-0548","summary":"`ZipStreamReader` extracts entries under local-header names that can differ from the central directory","details":"A ZIP archive names each entry twice: in the local file header in front of the entry's data, and in the central directory at the end of the archive. `ZipArchive` lists and opens entries by their central-directory names. `ZipStreamReader::visit` and `ZipStreamReader::extract`, like `read_zipfile_from_stream`, read the local headers in order and use the local-header names without comparing them with the central directory.\n\nAn archive can therefore show one set of file names to code that inspects it with `ZipArchive` and write files under other names when it is extracted with `ZipStreamReader`. If an application checks an archive one way and extracts it the other way, an attacker can get files written or overwritten inside the destination directory that the check never saw.\n\nThe fix adds an opt-in check. `ZipStreamReader::enforce_header_consistency(true)` compares each local header with its central-directory entry (name, sizes, CRC-32, compression method, flags and modification time) and fails extraction on a mismatch; `ZipReadOptions::enforce_header_consistency(true)` and `ZipArchive::validate_header_consistency()` do the same for `ZipArchive`. The check is off by default, so upgrading alone does not change what `ZipStreamReader::new(...)` extracts: applications that extract untrusted archives with `ZipStreamReader` need to turn it on.","aliases":["CVE-2026-115905","GHSA-m665-v7pm-7grj"],"modified":"2026-11-17T10:15:03.072952941Z","published":"2026-10-17T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/zip"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0548.html"},{"type":"WEB","url":"https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e"}],"affected":[{"package":{"name":"zip","ecosystem":"crates.io","purl":"pkg:cargo/zip"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"9.0.5"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"arch":[],"os":[],"functions":[]}},"database_specific":{"cvss":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0548.json","informational":null,"categories":["privilege-escalation"]}}],"schema_version":"1.9.2"}