Vulnerability · Published Apr 9, 2026 · Assigned by GitHub_M
CVE-2026-35041ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification
Medium 4.2
In plain English
A medium-severity regular-expression denial of service in fast-jwt from nearform. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 20% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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 & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | fast-jwt | 6.2.1 | GHSA-cjw9-ghj4-fwxf |
Affected products (as reported)
Weakness: CWE-1333 · Vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H
References
- https://github.com/nearform/fast-jwt/security/advisories/GHSA-cjw9-ghj4-fwxf x_refsource_CONFIRM
- https://github.com/nearform/fast-jwt/pull/595 x_refsource_MISC
- https://github.com/nearform/fast-jwt/commit/b0be0ca161593836a153d5180ca5358ad9b5de94 x_refsource_MISC
- https://github.com/nearform/fast-jwt/releases/tag/v6.2.1 x_refsource_MISC