CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-3PRJ-6HQW-CM82

GHSA-3PRJ-6HQW-CM82: CPU Amplification Denial of Service in web-token JWT Library

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 19, 2026·5 min read·4 visits

Executive Summary (TL;DR)

Unbounded iteration count (p2c) in PBES2 decryption allows attackers to block PHP worker threads via highly asymmetric CPU exhaustion attacks, leading to denial of service.

An uncontrolled resource consumption vulnerability in the PBES2-HS* key wrapping algorithms of the web-token JWT library allows remote, unauthenticated attackers to cause a denial of service (DoS) by sending JWE tokens with unbounded iteration counts.

Vulnerability Overview

The vulnerability tracked under the identifier GHSA-3PRJ-6HQW-CM82 is an uncontrolled resource consumption flaw (CWE-400) within the password-based key-encryption (PBES2) algorithms of the web-token JWT library and framework ecosystem.

Specifically, the issue arises when parsing JSON Web Encryption (JWE) tokens utilizing PBES2-based key wrapping, such as PBES2-HS256+A128KW. The library exposes an unauthenticated attack surface through token parsing endpoints, where any incoming encrypted token is processed prior to validation.

An attacker can exploit this endpoint by specifying an extremely high PBES2 iteration count (p2c) in the JOSE header. Because the library fails to limit this iteration value, the processing server executes an excessively long key derivation cycle, resulting in thread exhaustion.

Root Cause Analysis

Under the JSON Web Encryption (JWE) standards outlined in RFC 7518 Section 4.8, PBES2 algorithms utilize the Password-Based Key Derivation Function 2 (PBKDF2) to derive key-wrapping keys. This derivation process relies on two parameters supplied in the JWE header: the salt input (p2s) and the iteration count (p2c).

The vulnerability is located in the PBES2AESKW::unwrapKey() method, which performs the key-unwrapping sequence. Prior to invoking the underlying PBKDF2 function, the method executes validation logic via checkHeaderAdditionalParameters() to ensure the parameters are valid.

However, this validation check was insufficient, verifying only that the p2c parameter was a positive integer. By sending a JWE with an arbitrary, extremely high p2c value (such as 2,147,483,647), an attacker forces the server to call the native PHP hash_pbkdf2() function with that count.

Because PBKDF2 is computationally intensive by design, executing billions of HMAC iterations blocks the executing thread. This execution blocks the backend process before any signature or cryptographic integrity checks are executed.

Code Analysis

The vulnerability stems from the absence of a ceiling value for the p2c parameter in the PBES2AESKW abstract class. The following diff demonstrates the modifications applied to resolve this flaw:

--- a/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
+++ b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php
@@ -16,12 +16,16 @@
 use function in_array;
 use function is_int;
 use function is_string;
+use function sprintf;
 
 abstract readonly class PBES2AESKW implements KeyWrapping
 {
+    public const DEFAULT_MAX_COUNT = 1_000_000;
+
     public function __construct(
         private readonly int $salt_size = 64,
-        private readonly int $nb_count = 4096
+        private readonly int $nb_count = 4096,
+        private readonly int $max_count = self::DEFAULT_MAX_COUNT
     ) {
         if (! interface_exists(WrapperInterface::class)) {
             throw new RuntimeException('Please install "spomky-labs/aes-key-wrap" to use AES-KW algorithms');
@@ -139,6 +143,12 @@ protected function checkHeaderAdditionalParameters(array $header): void
         if (! is_int($header['p2c']) || $header['p2c'] <= 0) {
             throw new InvalidArgumentException('The header parameter "p2c" is not valid.');
         }
+        if ($header['p2c'] > $this->max_count) {
+            throw new InvalidArgumentException(sprintf(
+                'The header parameter "p2c" is too large. The maximum allowed value is %d.',
+                $this->max_count
+            ));
+        }
     }

The fix introduces a private parameter $max_count set to a default limit of 1,000,000. Inside checkHeaderAdditionalParameters(), the library compares the incoming p2c value against this ceiling before performing any decryption operations.

If the iteration count exceeds the maximum limit, the method immediately throws an InvalidArgumentException. This terminates token processing before calling hash_pbkdf2(), preventing CPU exhaustion.

Exploitation Methodology

To exploit this vulnerability, an attacker constructs a malformed JWE token with an inflated p2c parameter. This attack does not require a valid key, signature, or valid payload data, as the resource consumption occurs during the key derivation phase before ciphertext verification.

First, the attacker identifies an API endpoint that parses and decrypts JWE tokens. The attacker then prepares a JOSE header specifying a PBES2 algorithm and an inflated p2c value, such as 2,147,483,647.

The attacker encodes the JSON header using Base64URL and appends dummy values for the encrypted key, initialization vector, ciphertext, and authentication tag. When this JWE is transmitted via HTTP, the target server immediately blocks its processing worker, resulting in a denial-of-service condition if concurrent requests are sent.

Impact Assessment

The impact of this vulnerability is classified as High, with a CVSS v4 score of 8.7. The primary threat vector is application-level denial of service due to asymmetric CPU resource consumption.

Because the server performs key derivation prior to validating the cryptographic integrity of the token, the computational cost is highly asymmetric. The attacker spends minimal resources generating a small text string, while the server spends maximum CPU cycles performing billions of hash operations.

On standard hardware, an iteration count of 100,000,000 blocks a single thread for roughly 87 seconds. By sending multiple concurrent requests, an attacker can exhaust all available PHP-FPM worker processes, making the entire web application unavailable to legitimate traffic.

Remediation & Defense

The primary defense against this vulnerability is updating the web-token dependencies to a patched release. Users of the 3.4.x branch should upgrade to 3.4.10, while users of the 4.0.x and 4.1.x branches should upgrade to 4.0.7 and 4.1.7 respectively.

If immediate updates are not feasible, you can mitigate the risk by hardening the constructor parameters. Explicitly configuring a lower, safer maximum limit (such as 10,000) restricts the permissible computational overhead.

Additionally, applications that do not strictly require PBES2 algorithms should remove them from the registered decryption AlgorithmManager. Implementing a custom pre-decryption middleware to parse the JWE header and reject excessive p2c parameters also mitigates the risk.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Affected Systems

web-token/jwt-libraryweb-token/jwt-framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
web-token/jwt-library
web-token
< 3.4.103.4.10
web-token/jwt-library
web-token
>= 4.0.0, < 4.0.74.0.7
web-token/jwt-library
web-token
>= 4.1.0, < 4.1.74.1.7
web-token/jwt-framework
web-token
<= 4.1.64.1.7
AttributeDetail
Vulnerability IDGHSA-3PRJ-6HQW-CM82
CWE IDCWE-400 / CWE-770
Attack VectorNetwork
CVSS v4 Score8.7 (High)
Exploit StatusNone (No active public campaigns)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1499.003Endpoint Denial of Service: Application Exhaustion Flood
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, enabling an actor to influence the amount of resources consumed.

Vulnerability Timeline

Vulnerability discovered, fix released and advisory published as GHSA-3PRJ-6HQW-CM82
2026-06-18

References & Sources

  • [1]GitHub Security Advisory GHSA-3PRJ-6HQW-CM82
  • [2]Repository Advisory: PBES2-HS*+A*KW unwrap accepts an unbounded p2c iteration count
  • [3]GitHub Commit Diff: Security Fix Details
  • [4]FriendsOfPHP Security Advisory Database Entry
  • [5]RFC 7518 Section 4.8 - Password-Based Key Encryption with PBES2

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•36 minutes ago•CVE-2026-0755
9.8

CVE-2026-0755: Remote Code Execution and Arbitrary File Exfiltration in gemini-mcp-tool

CVE-2026-0755 is a critical vulnerability in gemini-mcp-tool (<= 1.1.5) that allows unauthenticated remote code execution on Windows installations and arbitrary local file exfiltration across all supported operating systems. The flaws exist within the execAsync command runner and the input handling logic of the Model Context Protocol (MCP) server, which fails to securely escape arguments passed to Node.js child processes and does not validate local file references in user-supplied prompt strings.

Alon Barad
Alon Barad
1 views•7 min read
•about 1 hour ago•GHSA-G7M4-839X-CH6V
8.7

GHSA-g7m4-839x-ch6v: Denial of Service via Unbounded Digits Parameter in spomky-labs/otphp

The spomky-labs/otphp library prior to version 11.4.3 is vulnerable to an unhandled DivisionByZeroError crash when parsing provisioning URIs containing a digits parameter value equal to or greater than 40. This allows unauthenticated remote attackers to trigger a Denial of Service by supplying a crafted URI, which causes float-to-integer cast overflow and subsequent division-by-zero fatal error in modern PHP runtimes.

Alon Barad
Alon Barad
2 views•7 min read
•about 2 hours ago•GHSA-2JX3-65F3-XR8R
5.3

GHSA-2JX3-65F3-XR8R: Dynamic Property Injection (Mass Assignment) in spomky-labs/otphp

A critical mass-assignment (property injection) vulnerability exists in the PHP One-Time Password (OTP) library spomky-labs/otphp within the Factory::loadFromProvisioningUri method. When an application loads an OTP provisioning URI (such as a QR code configuration link), a hostile URI can inject query parameters that dynamically overwrite internal, private, or read-only object properties of the OTP instance. This behavior leads to application state corruption, validation bypasses, or uncaught TypeErrors that crash the executing application process.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 3 hours ago•GHSA-6VVH-PXR4-25R7
5.9

GHSA-6vvh-pxr4-25r7: Cryptographic Integrity Degradation in JWT Framework ChaCha20-Poly1305 Key Encryption

An implementation flaw in the experimental Chacha20Poly1305 key-encryption algorithm within the PHP JWT Framework (web-token/jwt-framework) discards the Poly1305 authentication tag during key wrapping and omits it during decryption. This degrades the Authenticated Encryption with Associated Data (AEAD) protection to unauthenticated ChaCha20, allowing an attacker to manipulate the encrypted Content Encryption Key (CEK) without detection.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 5 hours ago•GHSA-JC38-X7X8-2XC8
8.1

GHSA-jc38-x7x8-2xc8: Algorithm Confusion and Header Override Vulnerability in PHP JWT Framework

An algorithm confusion vulnerability exists in the PHP JWT Framework (web-token/jwt-library) where the JWSVerifier and JWEDecrypter components merge integrity-protected and unprotected headers using insecure methods. Under specific conditions, duplicate parameters defined in unprotected headers override those in integrity-protected headers, allowing an attacker to bypass cryptographic signature verification.

Amit Schendel
Amit Schendel
5 views•7 min read
•about 6 hours ago•GHSA-5739-39V2-5754
6.3

GHSA-5739-39V2-5754: Bleichenbacher / Marvin Padding Oracle in PHP JWE Decryption (RSAES-PKCS1-v1_5)

An observable timing discrepancy vulnerability in the web-token/jwt-framework library allows unauthenticated remote attackers to perform a Bleichenbacher / Marvin padding oracle attack against JWE tokens using the RSAES-PKCS1-v1_5 algorithm. By failing to perform constant-time implicit rejection on PKCS#1 v1.5 padding failures, the decryption process leaks structural validation errors via exceptions and early returns, exposing the wrapped Content Encryption Key (CEK) to cryptographic recovery.

Amit Schendel
Amit Schendel
5 views•7 min read