Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incorrect comparison
|
| Impact | CVSS 5.3 with AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L indicates a network-accessible availability impact of low severity with no complexity barrier. However, this severity significantly understates the practical business risk. The vulnerability causes a deterministic denial of service pattern affecting 50% of legitimate authentication attempts in an alternating fashion, which can break production JWT authentication workflows and user experience. No public exploit code has been identified at the time of analysis, and CISA KEV status is not indicated, suggesting this may be a configuration-dependent issue primarily affecting applications using these specific RegExp modifiers. The impact is not authentication bypass but rather service degradation; attackers cannot forge or manipulate tokens, only cause legitimate tokens to be rejected intermittently. Organizations using fast-jwt with standard RegExp patterns in claim validation (without /g or /y modifiers) are unaffected. Real-world priority depends on configuration audit: services using the vulnerable patterns require immediate patching, while standard configurations pose minimal risk. |
| Exploit ScenarioDerived | An authenticated service using fast-jwt with a RegExp pattern containing /g modifier in the allowedIss option processes incoming JWT requests. Requests arrive in sequence: token A (valid) is rejected due to RegExp state from initialization, token B (valid) is accepted with correct RegExp state reset, token C (valid) is rejected as the /g modifier's lastIndex property carries over, creating an alternating rejection pattern. An attacker cannot forge valid tokens but observes that legitimate users experience 50% authentication failure rate, causing intermittent service degradation. No known public exploit code exists for this issue at the time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 09, 2026
fast-jwt before 6.2.1 fails to properly validate JWTs when RegExp modifiers with stateful behavior (/g for global matching and /y for sticky matching) are used in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options. This causes valid authentication tokens to be rejected in an alternating 50% failure pattern due to RegExp state persistence across verification calls, degrading availability of JWT-protected services without compromising token security itself. The vulnerability is fixed in version 6.2.1.
RemediationAI
Vendor-released patch: upgrade to fast-jwt version 6.2.1 or later. The fix is available at https://github.com/nearform/fast-jwt/releases/tag/v6.2.1. For immediate workaround prior to patching, audit verify() function configurations and remove /g and /y modifiers from any RegExp patterns used in allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options; replace stateful RegExp patterns with string matching or RegExp patterns without stateful modifiers. The upstream fix is documented in pull request https://github.com/nearform/fast-jwt/pull/593 and commit 18d25904e4617e8753526d1b3ab5a2cccdea726a.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
fast-jwt is a high-performance JWT library for Node.js that uses RegExp objects internally for claim validation. The root cause lies in CWE-697 (Incorrect Comparison), stemming from improper handling of stateful RegExp objects in claim verification logic. When developers configure verify() options with RegExp patterns containing the /g (global) or /y (sticky) modifiers, these modifiers maintain internal state (lastIndex property) between successive matches. During sequential token validations, the RegExp state from the previous verification attempt causes the next verification to start matching at an incorrect position or with incorrect flags, resulting in failed claim matching for valid tokens. This is specific to JavaScript/Node.js environments where RegExp objects are mutable and stateful, affecting all versions of fast-jwt prior to 6.2.1 as identified by CPE cpe:2.3:a:nearform:fast-jwt:*:*:*:*:*:*:*:*.
Know when Fast Jwt gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Related Vulnerabilities in fast-jwt Regular Expression DoS
View all 2Authentication and authorization bypass in fast-jwt 6.2.0 through 6.2.4 (npm, NearForm) lets a remote, unauthenticated a
Signed JSON Web Tokens whose payload is a JSON array silently bypass every configured claim validator in the npm package
Authentication and authorization bypass in fast-jwt 6.3.0 and earlier lets a remote, unauthenticated attacker submit a f
fast-jwt through 6.2.4 silently accepts expired and not-yet-active JSON Web Tokens when a verifier is constructed with c
fast-jwt provides fast JSON Web Token (JWT) implementation. Rated medium severity (CVSS 5.9), this vulnerability is remo
Signature-verification bypass in NearForm fast-jwt 6.2.4 lets a remote, unauthenticated attacker forge HS256-signed JWTs
Expired JSON Web Tokens can keep being accepted by fast-jwt through version 6.3.3 when the verifier is created with cach
EUVD-2026-20898
GHSA-3j8v-cgw4-2g6q
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB