
Cloud Vulnerability DB
A community-led vulnerabilities database
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.)
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.
SimpleFileOptions::default().with_deprecated_encryption(b"secret_password").[0x00; 10], an attacker does not need to guess any file content to perform a known-plaintext attack (Biham-Kocher / bkcrack).key0, key1, key2) can be recovered in minutes or seconds, completely bypassing password protection.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
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."