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

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-09T14:52:56.436Z
- Modified: 2026-10-26T21:10:00.170Z
- Also known as: GHSA-3j8v-cgw4-2g6q
- Weaknesses: CWE-440, CWE-697
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to 6.2.1, 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) and /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. This vulnerability is fixed in 6.2.1.

(As written by CVE List.)

## Affected

- nearform fast-jwt: < 6.2.1; before 6.2.1
- fast-jwt (npm): before 6.2.1

## Every score

- GitHub_M: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://github.com/nearform/fast-jwt/security/advisories/GHSA-3j8v-cgw4-2g6q> (exploit, mitigation, vendor-advisory, web)
- <https://github.com/nearform/fast-jwt/pull/593> (issue-tracking, patch, web)
- <https://github.com/nearform/fast-jwt/commit/18d25904e4617e8753526d1b3ab5a2cccdea726a> (patch, web)
- <https://github.com/nearform/fast-jwt/releases/tag/v6.2.1> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-35040> (advisory)
- <https://github.com/nearform/fast-jwt> (package)

## Sources

- CVE List: [CVE-2026-35040](https://www.cve.org/CVERecord?id=CVE-2026-35040), CVE Terms of Use, modified 2026-04-13
- GitHub Advisory Database: [GHSA-3j8v-cgw4-2g6q](https://github.com/advisories/GHSA-3j8v-cgw4-2g6q), CC-BY-4.0, modified 2026-04-09
- NVD: [CVE-2026-35040](https://nvd.nist.gov/vuln/detail/CVE-2026-35040), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-35040 · Whole record: https://cve.day/CVE-2026-35040.json · Rebuilt by cve.day 2026-11-25T22:59:18.376Z
