CVE-2026-35041

ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification

Published Apr 9, 2026 CVSS 3.1 · 4.2 Medium EPSS < 1% KEV · Not listed
Description
fast-jwt provides fast JSON Web Token (JWT) implementation. From 5.0.0 to 6.2.0, a denial-of-service condition exists in fast-jwt when the allowedAud verification option is configured using a regular expression. Because the aud claim is attacker-controlled and the library evaluates it against the supplied RegExp, a crafted JWT can trigger catastrophic backtracking in the JavaScript regex engine, resulting in significant CPU consumption during verification. This vulnerability is fixed in 6.2.1.

Analysis

AI-generated

Technical impact

A denial‑of‑service condition exists in the fast‑jwt library when the allowedAud verification option is configured with a regular expression. Attacker‑controlled JSON Web Token claim values are evaluated against the supplied RegExp, and a carefully crafted token can trigger catastrophic backtracking in the JavaScript regex engine. This results in elevated CPU consumption during verification, effectively exhausting server resources. The weakness is a classic Regular Expression Backtracking issue (CWE‑1333).

Affected Systems

The vulnerability affects the nearform Fast‑jwt library for Node.js. Versions from 5.0.0 through 6.2.0 are impacted. The issue is fixed in release 6.2.1 and later.

Risk and Exploitability

The CVSS score is 4.2, indicating moderate severity, and the EPSS score is below 1%, suggesting a low probability of exploitation in the wild at present. However, once a malicious JWT is presented to an application using this library with a RegExp allowedAud configuration, the backtracking can be triggered, which may allow an attacker to cause out‑of‑band denial of service. The vulnerability is not listed in the CISA KEV catalog, but care should be taken as it can be exploited remotely via the application’s authentication endpoint.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade fast-jwt to version 6.2.1 or later.
  • Review the library configuration to avoid using regular expressions for the allowedAud option; use literal strings or a static array of allowed values instead.
  • Monitor application performance and verify that token verification no longer triggers high CPU usage after the upgrade.

Generated by OpenCVE AI on April 14, 2026 at 21:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-cjw9-ghj4-fwxf fast-jwt has a ReDoS when using RegExp in allowed* leading to CPU exhaustion during token verification
History
Type Values Removed Values Added
CPEs cpe:2.3:a:nearform:fast-jwt:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
First Time appeared Nearform
Nearform fast-jwt
Vendors & Products Nearform
Nearform fast-jwt
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description fast-jwt provides fast JSON Web Token (JWT) implementation. From 5.0.0 to 6.2.0, a denial-of-service condition exists in fast-jwt when the allowedAud verification option is configured using a regular expression. Because the aud claim is attacker-controlled and the library evaluates it against the supplied RegExp, a crafted JWT can trigger catastrophic backtracking in the JavaScript regex engine, resulting in significant CPU consumption during verification. This vulnerability is fixed in 6.2.1.
Title ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification
Weaknesses CWE-1333
References
Metrics cvssV3_1

{'score': 4.2, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 9, 2026, 4:15 PM
Reserved
Mar 31, 2026, 9:06 PM
Status
Analyzed
Published
Apr 9, 2026, 4:16 PM
Modified
Oct 26, 2026, 10:10 PM