CVE-2026-137559 in jwt-library
Summary
by MITRE • 11/26/2026
web-token jwt-framework and jwt-library before 3.4.13, 4.0.x before 4.0.9, 4.1.x before 4.1.11, and 4.2.x before 4.2.6 allow CPU exhaustion because, on PHP without GMP, AbstractECDH falls back to pure PHP curve code that converts unbounded ECDH-ES epk x and y coordinates to big integers before any length check. Unauthenticated attackers who know only the recipient key's curve can send small JWEs with oversized epk coordinates, keeping workers busy for seconds to minutes per token.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/26/2026
The web-token library ecosystem, encompassing both jwt-framework and jwt-library versions prior to 3.4.13, 4.0.x before 4.0.9, 4.1.x before 4.1.11, and 4.2.x before 4.2.6, contains a critical resource exhaustion vulnerability rooted in the implementation of Elliptic Curve Diffie-Hellman Ephemeral key agreement for JSON Web Encryption. This flaw specifically affects environments running PHP without the GMP extension installed or enabled. In such configurations, the AbstractECDH class is forced to utilize pure PHP implementations for elliptic curve operations rather than leveraging optimized C-based extensions like GMP which handle large integer arithmetic more efficiently and securely. The core technical deficiency lies in the order of operations during the processing of Elliptic Curve Diffie-Hellman Ephemeral parameters, specifically regarding the public key coordinates epk x and y.
When a JSON Web Encryption token is processed, the library extracts the ephemeral public key from the JWE header to perform the key agreement calculation. The vulnerability arises because the code converts these unbounded coordinate values into big integers before performing any validation checks on their length or validity relative to the curve parameters. This sequence allows an attacker who possesses knowledge of the recipient's elliptic curve domain parameters, which are often public information in many cryptographic setups, to craft maliciously small JWE payloads containing oversized epk coordinates. By providing coordinate values that exceed standard bounds but remain syntactically valid within the JSON structure, the attacker triggers a computationally expensive conversion process in pure PHP.
The operational impact of this flaw is significant denial-of-service potential through CPU exhaustion. Because pure PHP arithmetic for large integers is orders of magnitude slower than native C extensions, processing these oversized coordinates consumes substantial computational resources. An unauthenticated remote attacker can exploit this by sending multiple requests with such crafted tokens to keep server workers busy for seconds or even minutes per token. This behavior effectively creates a low-bandwidth denial-of-service attack vector where minimal network traffic results in disproportionate CPU consumption on the backend servers, potentially leading to service degradation or complete unavailability depending on the concurrency limits of the hosting environment.
This vulnerability aligns with CWE-400 Uncontrolled Resource Consumption and falls under the MITRE ATT&CK technique T1496 Resource Hijacking, specifically within the context of cloud infrastructure where resource exhaustion can lead to increased costs or service disruption for legitimate users. To mitigate this risk, organizations must upgrade their web-token dependencies to version 3.4.13 or later, ensuring that all minor and patch versions across the 4.x branches are updated to at least 4.0.9, 4.1.11, or 4.2.6 respectively. Additionally, deploying a Web Application Firewall with rules capable of detecting anomalous JWE header sizes can provide an additional layer of defense by blocking requests containing abnormally large coordinate data before they reach the application logic. Ensuring that PHP environments utilize optimized cryptographic extensions like GMP where possible also reduces the performance impact should such inputs be encountered, although upgrading to patched versions remains the primary remediation strategy.