<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Jwt-Framework (&lt;= 4.1.6) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/jwt-framework--4.1.6/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 18 Jun 2026 21:15:29 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/jwt-framework--4.1.6/feed.xml" rel="self" type="application/rss+xml"/><item><title>PHP JWT Library PBES2-HS*+A*KW Unbounded p2c Iteration Count Leads to DoS</title><link>https://feed.craftedsignal.io/briefs/2026-06-php-jwt-pbes2-dos/</link><pubDate>Thu, 18 Jun 2026 21:15:29 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-06-php-jwt-pbes2-dos/</guid><description>An unauthenticated attacker can exploit a vulnerability in the PHP JWT Library's PBES2AESKW::unwrapKey() function when processing JWE tokens that use PBES2-HS*+A*KW algorithms by crafting a JWE with an excessively large 'p2c' (PBKDF2 iteration count) parameter in the JOSE header, forcing the server to perform an unbounded and CPU-intensive PBKDF2 computation, resulting in a CPU-amplification denial of service.</description><content:encoded><![CDATA[<p>A high-severity denial-of-service vulnerability (CWE-400) has been discovered in the PHP JWT Library (composer/web-token/jwt-library and jwt-framework), affecting versions prior to 3.4.10, 4.0.7, and 4.1.7. This flaw allows an unauthenticated attacker to trigger an unbounded CPU consumption on a server processing JSON Web Encryption (JWE) tokens. Specifically, when JWEs utilize password-based key-encryption algorithms (PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW), the <code>PBES2AESKW::unwrapKey()</code> function reads the <code>p2c</code> (PBKDF2 iteration count) parameter directly from the attacker-controlled JOSE header. The absence of an upper bound on this parameter allows attackers to specify extremely high iteration counts (e.g., 100,000,000 or PHP_INT_MAX), causing the server to expend significant CPU resources on PBKDF2 computations before any key unwrapping validation occurs. This resource exhaustion can lead to severe service degradation or unavailability for targeted applications.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated attacker crafts a malicious JSON Web Encryption (JWE) token.</li>
<li>The attacker manipulates the protected JOSE header of the JWE to include a <code>p2c</code> (PBKDF2 iteration count) parameter with an arbitrarily large integer value (e.g., <code>100,000,000</code> or <code>PHP_INT_MAX</code>).</li>
<li>The attacker sends this crafted JWE token to a vulnerable application endpoint (e.g., via an HTTP header, request body, or URL parameter).</li>
<li>The vulnerable PHP JWT Library receives the JWE and attempts to process it using a registered PBES2-HS*+A*KW algorithm for key unwrapping.</li>
<li>The <code>PBES2AESKW::unwrapKey()</code> function extracts the <code>p2c</code> value from the JOSE header without adequate upper bound validation, as only <code>is_int($p2c) &amp;&amp; $p2c &gt; 0</code> is checked.</li>
<li>The function initiates <code>hash_pbkdf2()</code> with the excessively large <code>p2c</code> value, forcing the server's CPU to perform an intensive, prolonged computation for PBKDF2 key derivation.</li>
<li>The server worker process becomes stalled, consuming significant CPU resources for an extended period (potentially tens of seconds per request), leading to resource exhaustion.</li>
<li>If sufficient malicious JWEs are processed, the application or server becomes unresponsive, resulting in a denial-of-service condition due to uncontrolled resource consumption.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability leads to a severe denial-of-service (DoS) condition. Attackers can force target servers to dedicate substantial CPU resources to perform computationally expensive PBKDF2 iterations, effectively stalling worker processes. This resource exhaustion prevents legitimate users from accessing the application, resulting in service unavailability and potential data loss if stateful operations are interrupted. While the vulnerability description does not specify observed victim counts or sectors, any application utilizing the affected PHP JWT Library and configured to accept JWEs with PBES2 algorithms is at risk, particularly those exposed to unauthenticated input. The cost to the attacker for generating the malicious JWE is negligible compared to the server's computational burden.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>composer/web-token/jwt-library</code> to versions 3.4.10, 4.0.7, or 4.1.7, or <code>composer/web-token/jwt-framework</code> to version 4.1.7 or later, which enforce a <code>DEFAULT_MAX_COUNT = 1_000_000</code> for <code>p2c</code>.</li>
<li>If immediate upgrade is not feasible, implement a custom header checker to validate and limit the <code>p2c</code> header parameter for JWEs before they are processed by the vulnerable library, as described in the source.</li>
<li>Disable PBES2 algorithms for JWE decryption if they are not strictly required, especially for tokens originating from untrusted sources.</li>
<li>Deploy the provided Sigma rules to your SIEM to detect attempts to exploit this vulnerability or identify applications configured to use the affected PBES2 algorithms.</li>
<li>Monitor web server and PHP application logs for HTTP requests containing JWEs that use PBES2 algorithms or include abnormally large <code>p2c</code> values, as described in the detection rules.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>denial-of-service</category><category>web</category><category>php</category><category>jwt</category><category>jwe</category><category>cwe-400</category></item></channel></rss>