Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. fast-jwt
  4. ›
  5. CVE-2026-35041

CVE-2026-35041: fast-jwt has a ReDoS when using RegExp in allowed* leading to CPU exhaustion during token verification

April 9, 2026

⚠️ IMPORTANT CLARIFICATIONS

Affected Configurations

This vulnerability ONLY affects applications that:

  • Use RegExp objects (not strings) in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options
  • Configure patterns susceptible to catastrophic backtracking
  • Example: allowedAud: /^(a+)+X$/ ← VULNERABLE
  • Example: allowedAud: "api.company.com" ← SAFE

Not Affected

  • Applications using string patterns for audience validation (most common)
  • Applications using safe RegExp patterns without nested quantifiers
  • Default fast-jwt configurations

Assessment Guide

To determine if you’re affected:

  1. Check ifallowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce use RegExp objects (/pattern/ or new RegExp())
  2. If yes, review the pattern for nested quantifiers like (a+)+, (.*)*, etc.
  3. If no RegExp usage, you are NOT affected

References

  • github.com/advisories/GHSA-cjw9-ghj4-fwxf
  • github.com/nearform/fast-jwt
  • github.com/nearform/fast-jwt/commit/b0be0ca161593836a153d5180ca5358ad9b5de94
  • github.com/nearform/fast-jwt/pull/595
  • github.com/nearform/fast-jwt/releases/tag/v6.2.1
  • github.com/nearform/fast-jwt/security/advisories/GHSA-cjw9-ghj4-fwxf
  • nvd.nist.gov/vuln/detail/CVE-2026-35041

Code Behaviors & Features

Detect and mitigate CVE-2026-35041 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 5.0.0 before 6.2.1

Fixed versions

  • 6.2.1

Solution

Upgrade to version 6.2.1 or above.

Impact 4.2 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity

Source file

npm/fast-jwt/CVE-2026-35041.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:20:09 +0000.