- Reported
-
- Issued
-
- Package
-
zip
(crates.io)
- Type
-
Vulnerability
- Categories
-
- Keywords
-
#aes
#hmac
#authentication
- Aliases
-
- References
-
- CVSS Score
- 6.5
MEDIUM
- CVSS Details
-
- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- Required
- Scope
- Unchanged
- Confidentiality Impact
- None
- Integrity Impact
- High
- Availability Impact
- None
- CVSS Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
- Patched
-
- Unaffected
-
Description
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.
Advisory available under CC0-1.0
license.