The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-35040

CVE-2026-35040: fast-jwt Auth Bypass Vulnerability

CVE-2026-35040 is an authentication bypass flaw in fast-jwt caused by stateful RegExp modifiers that reject valid tokens in alternating patterns. This article covers technical details, affected versions, and mitigation.

Published: April 9, 2026

CVE-2026-35040 Overview

CVE-2026-35040 is a Denial of Service vulnerability affecting the fast-jwt library, a popular JSON Web Token (JWT) implementation for Node.js applications. The vulnerability arises from improper handling of stateful RegExp modifiers in JWT verification options, causing intermittent authentication failures that reject 50% of valid tokens in an alternating pattern.

Critical Impact

Applications using fast-jwt with /g (global) or /y (sticky) RegExp modifiers in verify options will experience 50% authentication failure rates, causing significant availability issues for legitimate users.

Affected Products

  • fast-jwt versions prior to 6.2.1
  • Node.js applications using affected fast-jwt versions with RegExp options in verify functions
  • Authentication systems relying on allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options with stateful modifiers

Discovery Timeline

  • 2026-04-09 - CVE CVE-2026-35040 published to NVD
  • 2026-04-09 - Last updated in NVD database

Technical Details for CVE-2026-35040

Vulnerability Analysis

This vulnerability is classified under CWE-440 (Expected Behavior Violation). The root issue lies in JavaScript's RegExp object behavior when certain modifiers are used. When a RegExp object with the /g (global) or /y (sticky) modifier is used in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce verification options, the stateful nature of these modifiers causes unintended behavior during token validation.

JavaScript RegExp objects with global (/g) or sticky (/y) flags maintain an internal lastIndex property that tracks where the next match should begin. After a successful match, lastIndex advances past the matched portion. On subsequent calls with the same RegExp object, the search begins from this new position rather than the start of the string. This causes every second verification attempt to fail, as the matcher starts from an incorrect position.

It is important to note that this vulnerability does NOT allow invalid tokens to bypass authentication. Rather, it causes legitimate, valid tokens to be improperly rejected approximately 50% of the time in an alternating success-failure pattern.

Root Cause

The vulnerability stems from the reuse of RegExp objects with stateful modifiers across multiple verification calls. When developers configure verification options using patterns like /^expected-issuer$/g instead of /^expected-issuer$/, the RegExp's internal state persists between calls, causing the alternating failure pattern.

Attack Vector

This is a network-accessible vulnerability that does not require authentication or user interaction to trigger. While not a traditional security bypass, the denial of service impact is significant:

The vulnerability manifests when an application configures JWT verification with stateful RegExp modifiers. Each verification attempt alternates between success and failure regardless of token validity. An attacker could exploit this by simply making repeated authentication requests, knowing that approximately half of legitimate user sessions will experience authentication failures. This creates service degradation without requiring any malicious payload.

The attack does not require special privileges or complex preconditions—any application using the affected configuration will exhibit this behavior under normal operation.

Detection Methods for CVE-2026-35040

Indicators of Compromise

  • Intermittent authentication failures affecting approximately 50% of valid JWT verification attempts
  • Alternating success/failure patterns in authentication logs that don't correlate with token validity
  • User reports of random session failures or logout events
  • Increased support tickets related to authentication issues with no clear pattern

Detection Strategies

  • Review application code for RegExp objects using /g or /y modifiers in fast-jwt verify options
  • Audit allowedAud, allowedIss, allowedSub, allowedJti, and allowedNonce configuration parameters
  • Implement automated dependency scanning to identify fast-jwt versions below 6.2.1
  • Monitor authentication success/failure ratios for unusual patterns indicating 50% failure rates

Monitoring Recommendations

  • Implement authentication metrics tracking to detect abnormal failure rates
  • Set up alerts for sudden increases in JWT verification failures
  • Monitor application logs for RegExp-related errors during token verification
  • Track user session continuity to identify unexplained authentication drops

How to Mitigate CVE-2026-35040

Immediate Actions Required

  • Upgrade fast-jwt to version 6.2.1 or later immediately
  • Review all JWT verification configurations for RegExp patterns with /g or /y modifiers
  • Remove stateful modifiers from any RegExp patterns used in verification options
  • Test authentication flows thoroughly after configuration changes

Patch Information

The vulnerability has been fixed in fast-jwt version 6.2.1. The fix is available through the GitHub Release Version 6.2.1. Technical details of the fix can be reviewed in the GitHub Commit Changes and the GitHub Pull Request Discussion. The official GitHub Security Advisory GHSA-3j8v-cgw4-2g6q provides additional context.

Workarounds

  • Replace RegExp patterns using /g or /y modifiers with patterns without stateful flags
  • Use string values instead of RegExp objects for simple matching requirements in verify options
  • Create new RegExp instances for each verification call rather than reusing objects
  • Consider using array values with multiple allowed strings instead of complex RegExp patterns
bash
# Update fast-jwt to patched version
npm update fast-jwt@6.2.1

# Verify installed version
npm list fast-jwt

# Audit for vulnerable dependencies
npm audit

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechFast Jwt

  • SeverityMEDIUM

  • CVSS Score5.3

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-440
  • Technical References
  • GitHub Commit Changes

  • GitHub Pull Request Discussion

  • GitHub Release Version 6.2.1

  • GitHub Security Advisory GHSA-3j8v-cgw4-2g6q
  • Related CVEs
  • CVE-2026-44351: fast-jwt Auth Bypass Vulnerability

  • CVE-2026-35039: fast-jwt Auth Bypass Vulnerability

  • CVE-2026-34950: fast-jwt Auth Bypass Vulnerability

  • CVE-2026-35041: fast-jwt DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English