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

CVE-2026-35040: fast-jwt: Stateful RegExp (/g or /y) causes non-deterministic allowed-claim validation (logical DoS)

April 9, 2026

Using certain modifiers on RegExp objects in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options in verify functions can cause certain unintended behaviours. This is because some modifiers are stateful and will cause failures in every second verification attempt regardless of the validity of the token provided.

Such modifiers are:

  • /g : Global matching
  • /y : Sticky matching

This does NOT allow invalid tokens to be accepted, only for valid tokens to be improperly rejected in some configurations. Instead it causes 50% of valid authentication requests to fail in an alternating pattern, leading to:

  • Intermittent user authentication failures
  • Potential retry storms in applications
  • Operational monitoring alerts

References

  • github.com/advisories/GHSA-3j8v-cgw4-2g6q
  • github.com/nearform/fast-jwt
  • github.com/nearform/fast-jwt/commit/18d25904e4617e8753526d1b3ab5a2cccdea726a
  • github.com/nearform/fast-jwt/pull/593
  • github.com/nearform/fast-jwt/releases/tag/v6.2.1
  • github.com/nearform/fast-jwt/security/advisories/GHSA-3j8v-cgw4-2g6q
  • nvd.nist.gov/vuln/detail/CVE-2026-35040

Code Behaviors & Features

Detect and mitigate CVE-2026-35040 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 before 6.2.1

Fixed versions

  • 6.2.1

Solution

Upgrade to version 6.2.1 or above.

Impact 5.3 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-440: Expected Behavior Violation
  • CWE-697: Incorrect Comparison

Source file

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

Spotted a mistake? Edit the file on GitLab.

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

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