Vulnerability DatabaseGHSA-cm63-4mhh-887h

GHSA-cm63-4mhh-887h: 
Rust vulnerability analysis and mitigation

Summary

When reading an AES-encrypted entry using ZipFileReader::read_exact, the authentication code (HMAC-SHA1-80) at the end of the encrypted stream is never verified. An attacker capable of modifying the encrypted archive can tamper with the ciphertext without causing an authentication error when the consumer reads data with read_exact.

Details

In src/read/readers.rs, methods read, read_to_end, and read_to_string on ZipFileReader invoke self.finish_aes()? upon reaching EOF to consume trailing ciphertext and authenticate the HMAC code (implemented to address GHSA-c9rm-qm35-rhqf):

// src/read/readers.rs:192-198
ZipFileReader::CompressedAes(r) => {
    let n = r.read(buf)?;
    if n == 0 && !buf.is_empty() {
        self.finish_aes()?;
    }
    Ok(n)
}

However, read_exact directly delegates to the underlying decompressor without invoking finish_aes():

// src/read/readers.rs:230-238
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
    match self {
        ZipFileReader::NoReader => invalid_state!(),
        ZipFileReader::Raw(r) => r.read_exact(buf),
        ZipFileReader::Stored(r) => r.read_exact(buf),
        ZipFileReader::Compressed(r) => r.read_exact(buf),
        ZipFileReader::CompressedAes(r) => r.read_exact(buf), // <--- Bug: finish_aes() never called!
    }
}

When a caller allocates a buffer sized to entry.size() (uncompressed size) and calls reader.read_exact(&mut buf), the method returns Ok(()) successfully. The trailing HMAC-SHA1 authentication code is never read or verified. In AE-2 mode, standard ZIP CRC-32 verification is omitted (set to 0); thus, bypassing the HMAC verification leaves the stream with zero integrity checks, allowing silent bit-flipping / ciphertext tampering attacks.

Proof of Concept

  1. Create an AES-encrypted ZIP file with known content.
  2. Flip bits in the compressed payload of the encrypted entry.
  3. Open the archive with ZipArchive, resolve the file via by_name_decrypt(..., password).
  4. Call reader.read_exact(&mut buffer).
  5. Observed: read_exact succeeds with Ok(()), returning tampered plaintext without checking the auth code.
  6. Expected: read_exact should return an InvalidData error indicating HMAC authentication failure.

Impact

Integrity bypass / Tampering. Consumers using read_exact to read predictable-length secrets or configurations from AES-encrypted archives will process untrusted or maliciously manipulated data without detection.


Source: NVD

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-gfq6-89vx-q4j7CRITICAL9.3
  • Rust logoRust
  • zip
NoNoNov 16, 2026
GHSA-cm63-4mhh-887hCRITICAL9.2
  • Rust logoRust
  • zip
NoYesNov 16, 2026
GHSA-4963-ggxm-v64xMEDIUM6.9
  • Rust logoRust
  • zip
NoYesNov 16, 2026
GHSA-qg9m-hhhf-rqjcHIGHN/A
  • Rust logoRust
  • reed-compiler
NoYesNov 16, 2026
GHSA-4q2p-cw9r-mwxmLOWN/A
  • Rust logoRust
  • static-web-server
NoYesNov 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management