Skip to main content

Fast Jwt CVE-2026-35040

| EUVDEUVD-2026-20898 MEDIUM
Incorrect Comparison (CWE-697)
2026-04-09 GitHub_M GHSA-3j8v-cgw4-2g6q
5.3
CVSS 3.1 · Vendor: GitHub_M
View

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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

fast-jwt < 6.2.1

Affected Packages

npm fast-jwt fix: 6.2.1

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

Vendor (GitHub_M) PRIMARY 5.3 MEDIUM
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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

2
Patch released
Apr 09, 2026 - 20:30 nvd
Patch available
CVE Published
Apr 09, 2026 - 14:52 nvd
MEDIUM 5.3

DescriptionCVE.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

EPSS Score
0.1%
Top 81% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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 2

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy