Skip to main content
VulnerabilityPublished Updated

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

0

CVSS 8.7 High : upgrade to 3.4.10 soon.

Data as of 16 Jul 2026, 10:57 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
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:N

What 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

ProductAffectedFixed in
Packagistweb-token/jwt-libraryAffected
  • <3.4.10
Fixed in
  • 3.4.10
Packagistweb-token/jwt-frameworkAffected
  • <3.4.10
Fixed in
  • 3.4.10
Packagistweb-token/jwt-libraryAffected
  • >=4.0.0 <4.0.7
Fixed in
  • 4.0.7
Packagistweb-token/jwt-libraryAffected
  • >=4.1.0 <4.1.7
Fixed in
  • 4.1.7
Packagistweb-token/jwt-frameworkAffected
  • >=4.0.0 <4.0.7
Fixed in
  • 4.0.7
Packagistweb-token/jwt-frameworkAffected
  • >=4.1.0 <4.1.7
Fixed in
  • 4.1.7

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

Community reviews

Loading reviews…