{"id":"CVE-2025-27498","aliases":["CVE-2025-27498","GHSA-r38m-44fw-h886"],"related":[],"kind":"vulnerability","state":"published","title":"AEADs/ascon-aead: Plaintext exposed in decrypt_in_place_detached even on tag verification failure","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nIn `decrypt_in_place_detached`, the decrypted ciphertext (which is the correct ciphertext) is exposed even if the tag is incorrect.\n\n### Details\nThis is because in [decrypt_inplace](https://github.com/RustCrypto/AEADs/blob/8cda109f1128c4c7953a0bb0f53e1056d537e462/ascon-aead/src/asconcore.rs#L350-L364) 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\n\n### PoC\n```rust\nuse ascon_aead::Tag;\nuse ascon_aead::{Ascon128, Key, Nonce};\nuse ascon_aead::aead::{AeadInPlace, KeyInit};\n\nfn main() {\n\n    let key = Key::<Ascon128>::from_slice(b\"very secret key.\");\n    let cipher = Ascon128::new(key);\n\n    let nonce = Nonce::<Ascon128>::from_slice(b\"unique nonce 012\"); // 128-bits; unique per message\n\n    let mut buffer: Vec<u8> = Vec::new(); // Buffer needs 16-bytes overhead for authentication tag\n    buffer.extend_from_slice(b\"plaintext message\");\n\n    // Encrypt `buffer` in-place detached, replacing the plaintext contents with ciphertext\n    cipher.encrypt_in_place_detached(nonce, b\"\", &mut buffer).expect(\"encryption failure!\");\n    \n    // Decrypt `buffer` in-place with the wrong tag, ignoring the decryption error\n    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\"));\n\n    assert_eq!(&buffer, b\"plaintext message\");\n}\n```\n### Impact\nIf 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).","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-03-03T16:52:02.750Z","modified":"2026-06-17T09:03:42.923Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":5.6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-347"],"affected":[{"ranges":[{"version":"< 0.4.3","status":"affected"}],"vendor":"RustCrypto","product":"AEADs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.4.3"}],"ecosystem":"crates.io","package":"ascon_aead","purl":"pkg:cargo/ascon_aead","source":"ghsa"}],"references":[{"url":"https://github.com/RustCrypto/AEADs/security/advisories/GHSA-r38m-44fw-h886","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/RustCrypto/AEADs/commit/d1d749ba57e38e65b0e037cd744d0b17f7254037","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27498","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/RustCrypto/AEADs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-03-03T17:26:48.023Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-27498","url":"https://www.cve.org/CVERecord?id=CVE-2025-27498","licence":"CVE Terms of Use","modified":"2025-03-03T17:32:24.640Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r38m-44fw-h886","url":"https://github.com/advisories/GHSA-r38m-44fw-h886","licence":"CC-BY-4.0","modified":"2025-03-03T20:42:06.139Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-27498","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27498","licence":"Public domain","modified":"2026-06-17T09:03:42.923Z"}],"updatedAt":"2026-11-25T22:58:54.925Z","epss":{"score":0.00125,"percentile":0.0241,"date":"2026-12-01T12:00:22.000Z"}}