5.6medium
AEADs/ascon-aead: Plaintext exposed in decrypt_in_place_detached even on tag verification failure
- Severity
- 5.6medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.13% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-r38m-44fw-h886
Description
aes-gcm is a pure Rust implementation of the AES-GCM. In decrypt_in_place_detached, the decrypted ciphertext (which is the correct ciphertext) is exposed even if the tag is incorrect. This is because in decrypt_inplace in asconcore.rs, tag verification causes an error to be returned with the plaintext contents still in buffer. The vulnerability is fixed in 0.4.3.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| RustCrypto AEADs | < 0.4.3 | CVE List |
| ascon_aead (crates.io) | before 0.4.3 | GitHub Advisory Database |
All scores
| GitHub_M | 5.6medium CVSS:4.0 | CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:A/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:A/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
aes-gcm is a pure Rust implementation of the AES-GCM. In decrypt_in_place_detached, the decrypted ciphertext (which is the correct ciphertext) is exposed even if the tag is incorrect. This is because in decrypt_inplace in asconcore.rs, tag verification causes an error to be returned with the plaintext contents still in buffer. The vulnerability is fixed in 0.4.3.
GitHub Advisory Database
Summary
In decrypt_in_place_detached, the decrypted ciphertext (which is the correct ciphertext) is exposed even if the tag is incorrect.
Details
This is because in decrypt_inplace in asconcore.rs, tag verification causes an error to be returned with the plaintext contents still in buffer. The root cause of this vulnerability is similar to https://github.com/RustCrypto/AEADs/security/advisories/GHSA-423w-p2w9-r7vq
PoC
use ascon_aead::Tag;
use ascon_aead::{Ascon128, Key, Nonce};
use ascon_aead::aead::{AeadInPlace, KeyInit};
fn main() {
let key = Key::<Ascon128>::from_slice(b"very secret key.");
let cipher = Ascon128::new(key);
let nonce = Nonce::<Ascon128>::from_slice(b"unique nonce 012"); // 128-bits; unique per message
let mut buffer: Vec<u8> = Vec::new(); // Buffer needs 16-bytes overhead for authentication tag
buffer.extend_from_slice(b"plaintext message");
// Encrypt `buffer` in-place detached, replacing the plaintext contents with ciphertext
cipher.encrypt_in_place_detached(nonce, b"", &mut buffer).expect("encryption failure!");
// Decrypt `buffer` in-place with the wrong tag, ignoring the decryption error
let _ = cipher.decrypt_in_place_detached(nonce, b"", &mut buffer, Tag::<Ascon128>::from_slice(b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"));
assert_eq!(&buffer, b"plaintext message");
}
Impact
If a program continues to use the result of decrypt_in_place_detached after a decryption failure, the result will be unauthenticated. This may permit some forms of chosen ciphertext attacks (CCAs).
NVD (es)
aes-gcm es una implementación pura de Rust de AES-GCM. En decrypt_in_place_ Separate, el texto cifrado descifrado (que es el texto cifrado correcto) queda expuesto incluso si la etiqueta es incorrecta. Esto se debe a que en decrypt_inplace en asconcore.rs, la verificación de la etiqueta hace que se devuelva un error con el contenido del texto sin formato aún en el búfer. La vulnerabilidad se corrigió en 0.4.3.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-27498 changed 2025-03-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r38m-44fw-h886 changed 2025-03-03 | CC-BY-4.0 |
| NVD | CVE-2025-27498 changed 2026-06-17 | Public domain |