GHSA-3prj-6hqw-cm82: PHP JWT Library: PBES2-HS*+A*KW unwrap accepts an unbounded p2c iteration count, enabling CPU-amplification denial of service
Noroxi assessment
Priority: Monitor (action score 0/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: web-token/jwt-framework (Packagist) 4.0.7, 4.1.7, 3.4.10; web-token/jwt-library (Packagist) 4.0.7, 4.1.7, 3.4.10.
Low priority for now. Upgrade to web-token/jwt-framework (Packagist) 4.0.7, 4.1.7, 3.4.10; web-token/jwt-library (Packagist) 4.0.7, 4.1.7, 3.4.10 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: OSV
### Impact When a JWE uses a password-based key-encryption algorithm (`PBES2-HS256+A128KW`, `PBES2-HS384+A192KW`, `PBES2-HS512+A256KW`), `PBES2AESKW::unwrapKey()` reads the `p2c` (PBKDF2 iteration count) parameter directly from the attacker-controlled JOSE header and passes it to `hash_pbkdf2()` with **no upper bound**. The only validation performed (`checkHeaderAdditionalParameters()`) was `is_int($p2c) && $p2c > 0`. An unauthenticated attacker can craft a single JWE whose protected header sets a very large `p2c` (e.g. `100_000_000` ≈ 87 s of CPU, or `PHP_INT_MAX`), forcing a worker to spend an arbitrary amount of CPU inside PBKDF2 **before** the key unwrap can even fail. The decrypter swallows the eventual exception, so the attacker pays almost nothing while the server burns CPU. JSON General serialization (multiple recipients) and multi-key JWKSets multiply the cost. This is a classic uncontrolled-resource-consumption (CWE-400) denial of service. ### Affected configurations Applications that register any `PBES2-HS*+A*KW` algorithm in their decryption `AlgorithmManager`. ### Patches `PBES2AESKW` now enforces a configurable maximum iteration count (`DEFAULT_MAX_COUNT = 1_000_000`, well above realistic legitimate values which are a few thousand) in `checkHeaderAdditionalParameters()`, before any PBKDF2 computation. The bound is exposed as a constructor argument so operators can tune it. ### Workarounds Before upgrading: validate/limit the `p2c` header with a custom header checker, or do not enable PBES2 algorithms for untrusted tokens. ### References - RFC 7518 §4.8 (PBES2) - CWE-400: Uncontrolled Resource Consumption ## Résolution Un correctif a été préparé sur une branche dédiée basée sur `3.4.x`, avec des tests anti-régression dédiés (fork privé temporaire de cette advisory, PR #1). **PBES2** — `PBES2AESKW::unwrapKey()` borne désormais le paramètre `p2c` (constante `DEFAULT_MAX_COUNT = 1_000_000`, configurable via le constructeur) avant tout appel à `hash_pbkdf2()`, empêchant l'amplification CPU (DoS). **Validation :** `php -l` OK, PHPUnit vert, aucune nouvelle erreur PHPStan introduite (différentiel nul vs `3.4.x`), aucun commentaire ajouté dans le code source. Après merge, cascade prévue `3.4.x → 4.0.x → 4.1.x`.
- Published
- Jun 18, 2026
- Updated
- Jul 15, 2026
- EPSS
- —
- CWE
- CWE-400
Report tools
Action score
0
Low priority for now.
- CVSS
- 0 / 40 · —
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · —
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| Packagist | web-token/jwt-library | pkg:composer/web-token/jwt-library |
| Packagist | web-token/jwt-framework | pkg:composer/web-token/jwt-framework |
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Packagist | web-token/jwt-framework | from 4.0.0 · before 4.0.7 | 4.0.7 |
| Packagist | web-token/jwt-framework | from 4.1.0 · before 4.1.7 | 4.1.7 |
| Packagist | web-token/jwt-framework | before 3.4.10 | 3.4.10 |
| Packagist | web-token/jwt-library | from 4.0.0 · before 4.0.7 | 4.0.7 |
| Packagist | web-token/jwt-library | from 4.1.0 · before 4.1.7 | 4.1.7 |
| Packagist | web-token/jwt-library | before 3.4.10 | 3.4.10 |
Same product
Packagist: all recordsOther highest-scoring records for the same primary product.
- GHSA-5739-39v2-5754PHP JWT Library: RSA1_5 (RSAES-PKCS1-v1_5) decryption lacks implicit rejection, exposing a Bleichenbacher/Marvin padding oracle0Monitor
- GHSA-jc38-x7x8-2xc8PHP JWT Framework: JWSVerifier uses algorithm from unprotected header, enabling algorithm confusion attacks0Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Packagist:web-token/jwt-framework | 3.4.10 | Package registry (OSV) |
| Packagist:web-token/jwt-framework | 4.0.7 | Package registry (OSV) |
| Packagist:web-token/jwt-framework | 4.1.7 | Package registry (OSV) |
| Packagist:web-token/jwt-library | 3.4.10 | Package registry (OSV) |
| Packagist:web-token/jwt-library | 4.0.7 | Package registry (OSV) |
| Packagist:web-token/jwt-library | 4.1.7 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- Integrity
- Availability
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
Weakness class (CWE)
CWE-400 · Uncontrolled Resource ConsumptionCVSS vector
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
osv
Root cause
Code that parses nested structures sets no depth or size limit. A small input can turn into a disproportionate processing load.
The bug in code
The whole CWE-400 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
function expand(node) {
return node.children.map(expand);
}Fixed
const MAX_DEPTH = 32;
function expand(node, depth = 0) {
if (depth > MAX_DEPTH) throw new Error("too deep");
return node.children.map((c) => expand(c, depth + 1));
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Change log (2)
- Fix✗ → ✓
- CVSS8 → —
For records you follow, these changes also arrive as notifications. →
References
Show all references (5 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.