The vulnerability lies in Deno's AES-GCM implementation where the authentication tag is not properly validated after commit 0d1beed2e3633d71d5e288e0382b85be361ec13d. This commit refactored cryptographic operations, and in the process, the GCM tag validation became ineffective.
The core of the issue resides in the Rust function deno_node::ops::crypto::cipher::Decipher::final (in ext/node/ops/crypto/cipher.rs). While this function contains code that appears to perform the tag check (let tag = decipher.finish(); if tag.as_slice() == auth_tag), the advisory and PoC confirm that this check does not correctly reject tampered ciphertexts for AES-GCM modes. This means that even if the ciphertext is altered, the decryption process might complete without an error, violating the integrity guarantees of AES-GCM.
The JavaScript function Decipheriv.prototype.final (in ext/node/polyfills/internal/crypto/cipher.ts) serves as the entry point for this operation from TypeScript/JavaScript. It calls the native Rust implementation, and thus exposes the vulnerability. When an application uses crypto.createDecipheriv with an AES-GCM algorithm and calls final(), it would expect an error if the ciphertext or authentication tag is invalid. Due to this vulnerability, such an error is not reliably thrown.
The exploit scenario involves an attacker providing tampered ciphertext. A vulnerable application using Deno's AES-GCM decryption would fail to detect this tampering, potentially leading to processing of inauthentic data. The fix for this vulnerability, indicated by later commits (e.g., 4f27d7cdc02e3edfb9d36275341fb8185d6e99ed), would have rectified the validation logic within Decipher::final or its dependencies to ensure authentication tags are correctly checked.
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| deno | rust | >= 1.46.0, < 2.1.7 | 2.1.7 |
| deno_node | rust | >= 0.102.0, < 0.125.0 | 0.125.0 |
A Semantic Attack on Google Gemini - Read the Latest Research