Skip to main content

CVE-2025-54887: CWE-354: Improper Validation of Integrity Check Value in jwt ruby-jwe

Critical
VulnerabilityCVE-2025-54887cvecve-2025-54887cwe-354
Published: Fri Aug 08 2025 (08/08/2025, 00:06:20 UTC)
Source: CVE Database V5
Vendor/Project: jwt
Product: ruby-jwe

Description

jwe is a Ruby implementation of the RFC 7516 JSON Web Encryption (JWE) standard. In versions 1.1.0 and below, authentication tags of encrypted JWEs can be brute forced, which may result in loss of confidentiality for those JWEs and provide ways to craft arbitrary JWEs. This puts users at risk because JWEs can be modified to decrypt to an arbitrary value, decrypted by observing parsing differences and the GCM internal GHASH key can be recovered. Users are affected by this vulnerability even if they do not use an AES-GCM encryption algorithm for their JWEs. As the GHASH key may have been leaked, users must rotate the encryption keys after upgrading. This issue is fixed in version 1.1.1.

AI-Powered Analysis

AILast updated: 08/15/2025, 01:13:59 UTC

Technical Analysis

CVE-2025-54887 is a critical vulnerability affecting the ruby-jwe library, a Ruby implementation of the JSON Web Encryption (JWE) standard defined in RFC 7516. The vulnerability exists in versions 1.1.0 and below, where the authentication tags of encrypted JWEs can be brute forced. This weakness allows an attacker to bypass the integrity validation of the encrypted token, enabling them to craft arbitrary JWEs that decrypt to attacker-controlled plaintext values. The root cause is improper validation of the integrity check value (authentication tag), classified under CWE-354. Notably, this flaw is exploitable even if AES-GCM is not the encryption algorithm used, due to the ability to recover the internal GHASH key used in GCM mode by observing parsing differences during decryption attempts. The leakage of the GHASH key is particularly severe as it compromises the cryptographic integrity of the encryption scheme, allowing attackers to forge valid authentication tags. The vulnerability does not require any privileges or user interaction and can be exploited remotely over the network. The vendor has addressed this issue in version 1.1.1 of ruby-jwe. Users are strongly advised to upgrade and rotate encryption keys since the GHASH key may have been compromised prior to patching. Although no known exploits are reported in the wild yet, the high CVSS score of 9.1 reflects the critical impact on confidentiality and integrity, with no impact on availability. This vulnerability poses a significant risk to any system relying on ruby-jwe for secure token encryption, especially in web applications and APIs that use JWE for secure data exchange and authentication.

Potential Impact

For European organizations, the impact of CVE-2025-54887 is substantial. Many enterprises and public sector entities in Europe use Ruby-based web applications and services that may incorporate ruby-jwe for secure token encryption. Exploitation could lead to unauthorized disclosure of sensitive information, such as personally identifiable information (PII), financial data, or authentication credentials, violating GDPR and other data protection regulations. The ability to forge arbitrary JWEs also undermines trust in authentication and authorization mechanisms, potentially enabling privilege escalation or impersonation attacks. This could disrupt business operations, damage reputations, and result in regulatory penalties. Critical infrastructure and government services relying on Ruby applications are particularly at risk. The vulnerability’s ease of exploitation without authentication or user interaction increases the likelihood of targeted attacks or automated scanning by threat actors. Even organizations not directly using AES-GCM are affected, broadening the scope of impact. The need to rotate encryption keys post-upgrade adds operational complexity and risk during remediation.

Mitigation Recommendations

European organizations should immediately upgrade ruby-jwe to version 1.1.1 or later to remediate this vulnerability. Beyond patching, it is crucial to rotate all encryption keys used with ruby-jwe to invalidate any potentially compromised GHASH keys. Organizations should audit their codebases and dependencies to identify all instances of ruby-jwe usage, including transitive dependencies in Ruby gems. Implement strict cryptographic hygiene by enforcing key management best practices, such as using hardware security modules (HSMs) or secure key vaults for key storage and rotation. Conduct thorough testing to ensure that token validation and encryption behave correctly after the upgrade. Monitor application logs and network traffic for anomalous JWE parsing errors or repeated failed authentication tag validations, which may indicate exploitation attempts. Additionally, consider implementing layered security controls such as Web Application Firewalls (WAFs) with rules to detect and block malformed or suspicious JWE tokens. Finally, update incident response plans to include this vulnerability and train security teams on its detection and mitigation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-07-31T17:23:33.476Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6895495bad5a09ad00fe8c65

Added to database: 8/8/2025, 12:48:27 AM

Last enriched: 8/15/2025, 1:13:59 AM

Last updated: 9/19/2025, 3:46:07 PM

Views: 52

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats