medium4.2
CVE-2026-35041
fast-jwt has a ReDoS when using RegExp in allowed* leading to CPU exhaustion during token verification
Impact
fast-jwt provides fast JSON Web Token (JWT) implementation. From 5.0.0 to 6.2.0, a denial-of-service condition exists in fast-jwt when the allowedAud verification option is configured using a regular expression. Because the aud claim is attacker-controlled and the library evaluates it against the supplied RegExp, a crafted JWT can trigger catastrophic backtracking in the JavaScript regex engine, resulting in significant CPU consumption during verification. This vulnerability is fixed in 6.2.1.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | fast-jwt | >= 5.0.0, <= 6.2.0 | 6.2.1 |
Affected products
| Vendor | Product | Affected versions |
|---|---|---|
| Nearform | Fast-Jwt | from 5.0.0 before 6.2.1 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/nearform/fast-jwt/commit/b0be0ca161593836a153d5180ca5358ad9b5de94
- https://github.com/nearform/fast-jwt/pull/595
- https://github.com/nearform/fast-jwt/releases/tag/v6.2.1
- https://github.com/nearform/fast-jwt/security/advisories/GHSA-cjw9-ghj4-fwxf
- https://github.com/advisories/GHSA-cjw9-ghj4-fwxf
- https://nvd.nist.gov/vuln/detail/CVE-2026-35041