Skip to main content

CVE-2023-49290: CWE-400: Uncontrolled Resource Consumption in lestrrat-go jwx

Medium
VulnerabilityCVE-2023-49290cvecve-2023-49290cwe-400
Published: Mon Dec 04 2023 (12/04/2023, 23:42:53 UTC)
Source: CVE Database V5
Vendor/Project: lestrrat-go
Product: jwx

Description

lestrrat-go/jwx is a Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. A p2c parameter set too high in JWE's algorithm PBES2-* could lead to a denial of service. The JWE key management algorithms based on PBKDF2 require a JOSE Header Parameter called p2c (PBES2 Count). This parameter dictates the number of PBKDF2 iterations needed to derive a CEK wrapping key. Its primary purpose is to intentionally slow down the key derivation function, making password brute-force and dictionary attacks more resource- intensive. Therefore, if an attacker sets the p2c parameter in JWE to a very large number, it can cause a lot of computational consumption, resulting in a denial of service. This vulnerability has been addressed in commit `64f2a229b` which has been included in release version 1.2.27 and 2.0.18. Users are advised to upgrade. There are no known workarounds for this vulnerability.

AI-Powered Analysis

AILast updated: 07/08/2025, 03:12:28 UTC

Technical Analysis

CVE-2023-49290 is a medium-severity vulnerability classified under CWE-400 (Uncontrolled Resource Consumption) affecting the lestrrat-go/jwx Go module, which implements JOSE (JSON Object Signing and Encryption) standards including JWA, JWE, JWK, JWS, and JWT. The vulnerability arises from the handling of the 'p2c' parameter in the PBES2-* key management algorithms used in JWE encryption. The 'p2c' parameter specifies the number of iterations for the PBKDF2 (Password-Based Key Derivation Function 2), which is designed to slow down brute-force attacks by increasing computational cost. However, if an attacker sets this parameter to an excessively high value, it can cause the system to consume excessive CPU resources during key derivation, leading to a denial of service (DoS) condition. This vulnerability affects lestrrat-go/jwx versions prior to 1.2.27 and versions from 2.0.0 up to but not including 2.0.18. The issue has been fixed in versions 1.2.27 and 2.0.18 by limiting or properly handling the 'p2c' parameter to prevent resource exhaustion. No known exploits are currently in the wild, and no workarounds exist other than upgrading to the patched versions. The CVSS v3.1 score is 5.3 (medium), reflecting a network attack vector, no required privileges or user interaction, and impact limited to availability (denial of service). Confidentiality and integrity are not affected.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to the availability of services that rely on the lestrrat-go/jwx library for JOSE-based encryption and key management, particularly those using PBES2 algorithms with PBKDF2 iteration counts controlled by untrusted inputs. An attacker could craft malicious JWE tokens with extremely high 'p2c' values, causing excessive CPU consumption and potentially leading to service outages or degraded performance. This can disrupt authentication, authorization, or secure communication workflows that depend on JWE, impacting business continuity and user experience. While the vulnerability does not compromise data confidentiality or integrity directly, denial of service can have cascading effects, especially in critical infrastructure, financial services, or healthcare sectors prevalent in Europe. Additionally, automated systems or APIs processing JWE tokens without proper input validation are at higher risk. The absence of known exploits reduces immediate threat but does not eliminate the risk, especially as attackers may develop exploits once the vulnerability becomes widely known.

Mitigation Recommendations

The primary and only effective mitigation is to upgrade lestrrat-go/jwx to version 1.2.27 or later, or 2.0.18 or later, depending on the version line in use. Organizations should audit their codebases and dependencies to identify usage of lestrrat-go/jwx and confirm the version deployed. Additionally, implement input validation to restrict or sanitize the 'p2c' parameter in incoming JWE tokens if feasible, rejecting tokens with suspiciously high iteration counts. Monitoring CPU usage and implementing rate limiting or throttling on endpoints that process JWE tokens can help detect and mitigate potential DoS attempts. Employing Web Application Firewalls (WAFs) with custom rules to detect anomalous JWE payloads may provide additional protection. Finally, maintain an inventory of cryptographic libraries and ensure timely patching of dependencies to reduce exposure to similar vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2023-11-24T16:45:24.313Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68386826182aa0cae2801b7c

Added to database: 5/29/2025, 1:59:02 PM

Last enriched: 7/8/2025, 3:12:28 AM

Last updated: 8/16/2025, 1:32:45 AM

Views: 14

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