
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-35041 is a Regular Expression Denial of Service (ReDoS) vulnerability in the fast-jwt Node.js library, affecting versions 5.0.0 through 6.2.0. When the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce verification options are configured with a RegExp object containing nested quantifiers, an attacker can supply a crafted JWT aud claim that triggers catastrophic backtracking in the JavaScript regex engine, causing severe CPU exhaustion. The vulnerability was disclosed on April 9, 2026, and fixed in version 6.2.1. It carries a CVSS v3.1 base score of 6.5 (Medium) per NVD, though the GitHub advisory rates it 4.2 (Moderate) under a more restrictive scoring (GitHub Advisory).
The root cause is CWE-1333 (Inefficient Regular Expression Complexity): the library passes attacker-controlled JWT claim values directly to application-supplied RegExp objects without validating whether those patterns are safe against catastrophic backtracking. When a pattern such as /^(a+)+X$/ is used for allowedAud, an adversarial aud value like "a".repeat(n) + "Y" causes exponential evaluation time — measured at ~123 ms for n=24, ~1.97 s for n=28, and ~7.85 s for n=30. Crucially, signature verification occurs before claim validation, meaning the attacker must possess a validly signed JWT, making this an authenticated (post-signature) denial-of-service. The fix in PR #595 integrates the safe-regex2 library to detect unsafe patterns at verifier creation time and emit a FAST_JWT_UNSAFE_REGEXP process warning (GitHub Advisory, Fix PR).
Successful exploitation causes CPU exhaustion on the Node.js server processing JWT verification, blocking the event loop and degrading or completely halting API throughput. Affected deployment contexts include API gateways, authentication middleware, service-to-service communication, and OAuth/OIDC token validation pipelines. There is no confidentiality or integrity impact; the sole consequence is availability loss, which can cascade into service outages, increased serverless execution costs, and saturation of authentication infrastructure (GitHub Advisory).
A proof-of-concept exploit (poc-suite-redos-fastjwt.js) is publicly referenced in the GitHub security advisory, with concrete reproduction steps. Exploitation requires the attacker to hold a validly signed JWT and have control over the aud claim — feasible in shared-secret environments, internal microservice architectures, or OAuth/OIDC flows. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.03% (GitHub Advisory, Feedly).
fast-jwt versions 5.0.0–6.2.0 with a RegExp object (e.g., /^(a+)+X$/) in allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options.aud claim: Set the aud claim to a string designed to trigger catastrophic backtracking against the target regex — for example, "a".repeat(28) + "Y" against a pattern like /^(a+)+X$/.fast-jwt's createVerifier() with the vulnerable RegExp option.aud values.aud claim strings.FAST_JWT_UNSAFE_REGEXP emitted at startup (after upgrading to 6.2.1), indicating a previously unsafe RegExp was in use (GitHub Advisory, Fix Commit).Upgrade fast-jwt to version 6.2.1 or later, which adds construction-time detection of unsafe RegExp patterns via the safe-regex2 library and emits a FAST_JWT_UNSAFE_REGEXP warning for any vulnerable configuration. As an interim workaround, replace RegExp-based allowedAud/allowedIss/allowedSub/allowedJti/allowedNonce options with string values where possible, or ensure any RegExp used does not contain nested quantifiers (e.g., (a+)+, (a*)+, (\w+)+). Additionally, implement rate limiting and request timeouts on JWT verification endpoints to limit the blast radius of any exploitation attempt (GitHub Advisory, Release v6.2.1).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."