fast-jwt: Stateful RegExp (/g or /y) causes non-deterministic allowed-claim validation (logical DoS)
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to 6.2.1, using certain modifiers on RegExp objects in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options in verify functions can cause certain unintended behaviours. This is because some modifiers are stateful and will cause failures in every second verification attempt regardless of the validity of the token provided. Such modifiers are /g (global matching) and /y (sticky matching). This does NOT allow invalid tokens to be accepted, only for valid tokens to be improperly rejected in some configurations. Instead it causes 50% of valid authentication requests to fail in an alternating pattern. This vulnerability is fixed in 6.2.1.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| nearform | fast-jwt | before 6.2.1 | 6.2.1 | Patch available | CNA |
| — | fast-jwt (npm) | before 6.2.1 | 6.2.1 | Patch available | GHSA-3j8v-cgw4-2g6q |
- fast-jwt Vendornearform Affected before 6.2.1 Fixed in 6.2.1 Patch available CNA
- fast-jwt (npm) Vendor— Affected before 6.2.1 Fixed in 6.2.1 Patch available GHSA-3j8v-cgw4-2g6q
Remediation
- Fix · CNA fast-jwt (nearform) Fixed in 6.2.1
- Fix · GHSA-3j8v-cgw4-2g6q fast-jwt (npm) Fixed in 6.2.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-35040
- 2026-10-03 Alias added: GHSA-3j8v-cgw4-2g6q
References
Patch 2
More nearform Fast-jwt vulnerabilities
- TI-2026-27174 fast-jwt has an incomplete fix for CVE-2023-48223: JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key CVSS 3.1CRITICAL 9.1
- TI-2026-27245 fast-jwt accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation) CVSS 3.1HIGH 7.5
- TI-2026-27244 ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification CVSS 3.1MEDIUM 6.5
- TI-2026-27242 Insufficient verification of data authenticity in nearform fast-jwt CVSS 3.1CRITICAL 9.1
- TI-2023-26087 fast-jwt JWT Algorithm Confusion CVSS 3.1MEDIUM 5.9
Sources
- CVE-2026-35040 · CVE Program
- CVE-2026-35040 · NVD
- FIRST EPSS
- GHSA-3j8v-cgw4-2g6q · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences