web-token/jwt-library · PHP JWT Library: PBES2-HS*+A*KW unwrap accepts an unbounded p2c iteration count, enabling CPU-amplification denial of service
Affects web-token/jwt-librarySource GCVE Database
CVSS 8.7 High : upgrade to 3.4.10 soon.
Data as of 16 Jul 2026, 10:57 UTC
- Patch
- Available – fixed in 3.4.10, 4.0.7, 4.1.7
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NWhat to do
Upgrade web-token/jwt-library and web-token/jwt-framework to 3.4.10; web-token/jwt-library and web-token/jwt-framework to 4.0.7; web-token/jwt-library and web-token/jwt-framework to 4.1.7.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Packagistweb-token/jwt-library | Affected
| Fixed in
|
| Packagistweb-token/jwt-framework | Affected
| Fixed in
|
| Packagistweb-token/jwt-library | Affected
| Fixed in
|
| Packagistweb-token/jwt-library | Affected
| Fixed in
|
| Packagistweb-token/jwt-framework | Affected
| Fixed in
|
| Packagistweb-token/jwt-framework | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available that enforces a configurable maximum iteration count (default 1,000,000) in the PBES2AESKW::unwrapKey() method before any PBKDF2 computation. Operators should upgrade to a fixed version to mitigate the vulnerability. Before upgrading, as a workaround, validate or limit the p2c header parameter with a custom header checker or disable PBES2 algorithms for untrusted tokens. Do not rely on the default unbounded iteration count.
Description
The PHP JWT Library contains a vulnerability in its PBES2-HS*+A*KW key unwrapping implementation where the iteration count parameter (p2c) from the attacker-controlled JOSE header is not properly bounded. This allows an unauthenticated attacker to specify an extremely large iteration count, causing excessive CPU consumption during PBKDF2 computation and resulting in a denial of service. The vulnerability affects applications that enable PBES2 algorithms for decryption. A patch has been introduced that enforces a configurable maximum iteration count to prevent CPU amplification attacks.
References
- github.com/web-token/jwt-framework/security/advisories/GHSA-3prj-6hqw-cm82 (opens in a new tab)
- github.com/FriendsOfPHP/security-advisories/blob/master/web-token/jwt-library/GHSA-3prj-6hqw-cm82.yaml (opens in a new tab)
- github.com/web-token/jwt-framework (opens in a new tab)
- github.com/web-token/jwt-framework/releases/tag/3.4.10 (opens in a new tab)
- github.com/web-token/jwt-framework/releases/tag/4.0.7 (opens in a new tab)
- github.com/web-token/jwt-framework/releases/tag/4.1.7 (opens in a new tab)