Vulnerability DatabaseGHSA-4963-ggxm-v64x

GHSA-4963-ggxm-v64x: 
Rust vulnerability analysis and mitigation

Summary

The implementation of PKZIP ZipCrypto encryption in src/write.rs initializes the 12-byte encryption header with static zero bytes instead of cryptographically secure random bytes (CSPRNG). Because ZipCrypto is a stream cipher, this emits 10 bytes of raw keystream directly into the archive, allowing attackers to recover internal encryption keys via known-plaintext attacks without knowing any of the file's contents. (This is considered a low confidentiality impact because ZipCrypto has publicly-known weaknesses even when implemented optimally.)

Details

In src/write.rs, the implementation of traditional PKZIP ZipCrypto encryption initializes the 12-byte encryption header with static zero bytes instead of cryptographically secure random bytes. According to PKZIP APPNOTE.TXT (Section 6.1.5):

"The encryption header is 12 bytes long... The first 10 or 11 bytes of the encryption header should be random data." However, in src/write.rs:846-868:

let mut crypto_header = [0u8; 12];
// ...
crypto_header[10..=11].copy_from_slice(
    &file
        .last_modified_time
        .unwrap_or_else(DateTime::default_for_write)
        .timepart()
        .to_le_bytes(),
);
let result = zipwriter.write_all(&crypto_header);

Bytes 0..10 of crypto_header are never populated with random data and remain strictly 0x00. Because ZipCrypto is a byte-by-byte stream cipher where ciphertext is computed as C[i] = P[i] ^ K[i], encrypting P[0..10] = 0x00 produces C[i] = 0x00 ^ K[i] = K[i]. The initial 10 bytes of the internal keystream are emitted directly into the archive without any entropy.

Proof of concept

  1. Create any encrypted ZIP archive using SimpleFileOptions::default().with_deprecated_encryption(b"secret_password").
  2. Inspect the raw bytes written immediately following the local file header (offset 30 + filename_length).
  3. The first 12 bytes constitute the encrypted header.
  4. Because the underlying plaintext of the first 10 bytes is deterministically [0x00; 10], an attacker does not need to guess any file content to perform a known-plaintext attack (Biham-Kocher / bkcrack).
  5. With 10 consecutive bytes of known plaintext at a fixed offset, the internal key state (key0, key1, key2) can be recovered in minutes or seconds, completely bypassing password protection.

Impact

Confidentiality breach / Loss of encryption guarantees (CWE-330 / CWE-327). Any archive generated with with_deprecated_encryption leaks 10 contiguous bytes of known plaintext at a deterministic position. Attackers can trivially recover the internal keys using standard known-plaintext reduction tools (such as bkcrack) without requiring any prior knowledge of the encrypted file's actual contents.


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