Medium, CVSS 4.7crates.ioPublished
AEADs/aes-gcm: Plaintext exposed in decrypt_in_place_detached even on tag verification failure
CVE-2023-42811 · GHSA-423w-p2w9-r7vq
- Affected
- crates.io aes-gcm >= 0.10.0, <= 0.10.2
- Fixed in
- 0.10.3· Vendor fix available
- Issue
- In the AES GCM implementation of decryptinplacedetached, the decrypted ciphertext (i.e. the correct plaintext) is exposed even if tag verification fails. Impact If a program using the aes-gcm crate's decryptinplace APIs accesses the buffer after decryption failure, it will contain a decryption of an unauthenticated input. Depending on the specific nature of the program this may enable Chosen Ciphertext Attacks (CCAs) which can cause a catastrophic breakage of the cipher including full plaintext recovery. Details As seen in the implementation of decryptinplacedetached for AES GCM, if the tag verification fails, an error is returned. Because the decryption of the ciphertext is done in place, the plaintext contents are now exposed via buffer. This should ideally not be the case - as noted in page 17 of NIST's publication Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC: In Step 8, the result of Step 7 is compared with the authentication tag…
Recommended action: Upgrade to 0.10.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.