Plaintext exposed in decrypt_in_place_detached even on tag verification failure
## Summary In the AES GCM implementation of decrypt_in_place_detached, 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 decrypt_in_place* 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 decrypt_in_place_detached 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 that was received as an input: if they are identical, then the plaintext is returned; otherwise,FAIL is returned. This is seems correctly addressed in the AES GCM SIV implementation, where the decrypted buffer is encrypted again before the error is returned - this fix is straightforward to implement in AES GCM. To ensure that these types of cases are covered during testing, it would be valuable to add test cases like 23, 24 etc from project wycheproof to ensure that when a bad ta
- Products
- aes-gcm
- Affected versions
- Not specified
- Fixed versions
- 0.10.3
- CVEs
- CVE-2023-42811
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:42 UTC · Revision 1
Source evidence
Plaintext exposed in decrypt_in_place_detached even on tag verification failure
core-osv · Original sourcePublished 22 Nov 2023, 12:00 UTC
## Summary In the AES GCM implementation of decrypt_in_place_detached, 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 decrypt_in_place* 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 decrypt_in_place_detached 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 that was received as an input: if they are identical, then the plaintext is returned; otherwise,FAIL is returned. This is seems correctly addressed in the AES GCM SIV implementation, where the decrypted buffer is encrypted again before the error is returned - this fix is straightforward to implement in AES GCM. To ensure that these types of cases are covered during testing, it would be valuable to add test cases like 23, 24 etc from project wycheproof to ensure that when a bad ta
osv:RUSTSEC-2023-0096
aes-gcm
Fixed versions: 0.10.3
Complete source record
{
"id": "c5f5a99fd9e3ecb1f4d8f930e1ec73b2d59f0d3383fdf09f61ee67775a2da56d",
"url": "https://osv.dev/vulnerability/RUSTSEC-2023-0096",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Plaintext exposed in decrypt_in_place_detached even on tag verification failure",
"summary": "## Summary In the AES GCM implementation of decrypt_in_place_detached, 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 decrypt_in_place* 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 decrypt_in_place_detached 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 that was received as an input: if they are identical, then the plaintext is returned; otherwise,FAIL is returned. This is seems correctly addressed in the AES GCM SIV implementation, where the decrypted buffer is encrypted again before the error is returned - this fix is straightforward to implement in AES GCM. To ensure that these types of cases are covered during testing, it would be valuable to add test cases like 23, 24 etc from project wycheproof to ensure that when a bad ta",
"evidence": "osv:RUSTSEC-2023-0096",
"products": [
{
"name": {
"value": "aes-gcm",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.10.3",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "RUSTSEC-2023-0096",
"aliases": [
"CVE-2023-42811",
"GHSA-423w-p2w9-r7vq",
"RUSTSEC-2023-0096"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.10.0"
},
{
"fixed": "0.10.3"
}
]
}
],
"package": {
"name": "aes-gcm",
"purl": "pkg:cargo/aes-gcm",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:H/A:N",
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2023-0096.json",
"categories": [
"crypto-failure"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": [
"aes_gcm::AeadInPlace::decrypt_in_place_detached",
"aes_gcm::AesGcm::decrypt_in_place_detached"
]
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:05.861248756Z",
"provider": "osv",
"references": [
"https://crates.io/crates/aes-gcm",
"https://rustsec.org/advisories/RUSTSEC-2023-0096.html",
"https://github.com/RustCrypto/AEADs/pull/551"
],
"provider_metadata": {
"license": "CC-BY-4.0"
}
},
"related_cves": [
{
"value": "CVE-2023-42811",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 306354,
"published_at": "2023-11-22T12:00:00+00:00"
}