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

Medium 4.2 Published Updated

Attackers can cause CPU exhaustion in fast-jwt by sending crafted tokens when allowedAud is configured with a vulnerable regular expression.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-35041?

CVE-2026-35041 is a medium-severity denial of service vulnerability in nearform fast-jwt, published on 9 Apr 2026. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

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

Weakness: CWE-1333

Which versions are affected by CVE-2026-35041?

2 open source packages ship an affected version, including fast-jwt. It affects 1 product.

PackageAffectedFixed in
fast-jwt npmFrom 5.0.06.2.1
fast-jwt npmFrom 5.0.06.2.1

Products include Nearform Fast-Jwt.

How do I fix CVE-2026-35041?

Upgrade fast-jwt to 6.2.1 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-35041 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-35041 exists.

Sources

Also known as GHSA-cjw9-ghj4-fwxf.

Is CVE-2026-35041 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free