CVE-2026-35040: CWE-697: Incorrect Comparison in nearform fast-jwt
CVE-2026-35040 affects the fast-jwt library prior to version 6. 2. 1. The vulnerability arises from the use of stateful RegExp modifiers (/g and /y) in certain verification options, causing valid tokens to be rejected in an alternating pattern. This does not allow invalid tokens to be accepted but results in approximately 50% of valid authentication attempts failing intermittently. The issue is fixed in version 6. 2. 1.
AI Analysis
Technical Summary
The fast-jwt library versions before 6.2.1 have an incorrect comparison issue due to the use of stateful regular expression modifiers (/g and /y) in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options during token verification. These modifiers cause the RegExp to maintain state between calls, leading to failures on every second verification attempt regardless of token validity. This results in valid tokens being improperly rejected about half the time. The vulnerability does not allow acceptance of invalid tokens. The problem is resolved in fast-jwt version 6.2.1.
Potential Impact
The impact is limited to availability of authentication services, as about 50% of valid JWT authentication requests may fail intermittently when using affected versions with certain RegExp modifiers. There is no confidentiality or integrity impact since invalid tokens are not accepted. This can cause denial of service for legitimate users relying on fast-jwt for JWT verification under the affected configurations.
Mitigation Recommendations
Upgrade fast-jwt to version 6.2.1 or later where this issue is fixed. Avoid using stateful RegExp modifiers (/g and /y) in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options in verify functions if upgrading is not immediately possible. Patch status is not explicitly stated but the fix is available in version 6.2.1.
CVE-2026-35040: CWE-697: Incorrect Comparison in nearform fast-jwt
Description
CVE-2026-35040 affects the fast-jwt library prior to version 6. 2. 1. The vulnerability arises from the use of stateful RegExp modifiers (/g and /y) in certain verification options, causing valid tokens to be rejected in an alternating pattern. This does not allow invalid tokens to be accepted but results in approximately 50% of valid authentication attempts failing intermittently. The issue is fixed in version 6. 2. 1.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The fast-jwt library versions before 6.2.1 have an incorrect comparison issue due to the use of stateful regular expression modifiers (/g and /y) in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options during token verification. These modifiers cause the RegExp to maintain state between calls, leading to failures on every second verification attempt regardless of token validity. This results in valid tokens being improperly rejected about half the time. The vulnerability does not allow acceptance of invalid tokens. The problem is resolved in fast-jwt version 6.2.1.
Potential Impact
The impact is limited to availability of authentication services, as about 50% of valid JWT authentication requests may fail intermittently when using affected versions with certain RegExp modifiers. There is no confidentiality or integrity impact since invalid tokens are not accepted. This can cause denial of service for legitimate users relying on fast-jwt for JWT verification under the affected configurations.
Mitigation Recommendations
Upgrade fast-jwt to version 6.2.1 or later where this issue is fixed. Avoid using stateful RegExp modifiers (/g and /y) in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options in verify functions if upgrading is not immediately possible. Patch status is not explicitly stated but the fix is available in version 6.2.1.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-31T21:06:06.428Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69d843791cc7ad14da3fb6ab
Added to database: 4/10/2026, 12:25:29 AM
Last enriched: 4/10/2026, 12:36:32 AM
Last updated: 4/10/2026, 2:37:11 AM
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.