CVE-2026-35040
fast-jwt: Stateful RegExp (/g or /y) causes non-deterministic allowed-claim validation (logical DoS)
Description
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.
INFO
Published Date :
April 9, 2026, 4:16 p.m.
Last Modified :
April 17, 2026, 8:10 p.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | [email protected] | ||||
| CVSS 3.1 | MEDIUM | MITRE-CVE |
Solution
- Update fast-jwt to version 6.2.1.
- Remove stateful RegExp modifiers like /g or /y.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-35040.
| URL | Resource |
|---|---|
| https://github.com/nearform/fast-jwt/commit/18d25904e4617e8753526d1b3ab5a2cccdea726a | Patch |
| https://github.com/nearform/fast-jwt/pull/593 | Issue Tracking Patch |
| https://github.com/nearform/fast-jwt/releases/tag/v6.2.1 | Product Release Notes |
| https://github.com/nearform/fast-jwt/security/advisories/GHSA-3j8v-cgw4-2g6q | Exploit Mitigation Vendor Advisory |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-35040 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-35040
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-35040 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-35040 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Apr. 17, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:nearform:fast-jwt:*:*:*:*:*:node.js:*:* versions up to (excluding) 6.2.1 Added Reference Type GitHub, Inc.: https://github.com/nearform/fast-jwt/commit/18d25904e4617e8753526d1b3ab5a2cccdea726a Types: Patch Added Reference Type GitHub, Inc.: https://github.com/nearform/fast-jwt/pull/593 Types: Issue Tracking, Patch Added Reference Type GitHub, Inc.: https://github.com/nearform/fast-jwt/releases/tag/v6.2.1 Types: Product, Release Notes Added Reference Type GitHub, Inc.: https://github.com/nearform/fast-jwt/security/advisories/GHSA-3j8v-cgw4-2g6q Types: Exploit, Mitigation, Vendor Advisory -
New CVE Received by [email protected]
Apr. 09, 2026
Action Type Old Value New Value Added Description 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. Added CVSS V3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L Added CWE CWE-440 Added CWE CWE-697 Added Reference https://github.com/nearform/fast-jwt/commit/18d25904e4617e8753526d1b3ab5a2cccdea726a Added Reference https://github.com/nearform/fast-jwt/pull/593 Added Reference https://github.com/nearform/fast-jwt/releases/tag/v6.2.1 Added Reference https://github.com/nearform/fast-jwt/security/advisories/GHSA-3j8v-cgw4-2g6q