CVE-2025-54887: JWE is missing AES-GCM authentication tag validation in encrypted JWE
9.1
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
jwe | rubygems | <= 1.1.0 | 1.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The security vulnerability is a critical flaw in the JWE decryption process for the AES-GCM encryption algorithm. Specifically, the code failed to validate the length of the authentication tag before using it in the decryption cipher. This omission allows for a practical brute-force attack on the tag. An attacker can submit JWEs with incrementally guessed tags and, by observing the server's responses, can reconstruct the full, valid authentication tag. A successful attack not only allows the decryption of sensitive information but also enables the attacker to recover the internal GHASH key, which grants them the ability to forge arbitrary JWEs that will be accepted as valid. The patch addresses this by introducing a strict length check on the authentication tag within the JWE::Enc::AesGcm.setup_cipher
method, which is called by the JWE::Enc::AesGcm.decrypt
method, thus closing the vulnerability.
Vulnerable functions
JWE::Enc::AesGcm.setup_cipher
lib/jwe/enc/aes_gcm.rb
JWE::Enc::AesGcm.decrypt
lib/jwe/enc/aes_gcm.rb