{"answers":{"affected":"2 open source packages ship an affected version, including fast-jwt. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-35040 exists.","fix":"Upgrade fast-jwt to 6.2.1 or later.","what":"CVE-2026-35040 is a medium-severity denial of service vulnerability in nearform fast-jwt, published on 9 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-35040 and fix it if it is affected.\n\nWhat it is: CVE-2026-35040 is a medium-severity denial of service vulnerability in nearform fast-jwt, published on 9 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-35040 exists.\n\nAffected packages and fixed versions:\n- fast-jwt (npm): affected all versions; fixed in 6.2.1\n- fast-jwt (npm): affected all versions; fixed in 6.2.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-35040/ (Markdown: https://insights.sbomify.com/CVE-2026-35040/index.md)","id":"CVE-2026-35040","markdown":"https://insights.sbomify.com/CVE-2026-35040/index.md","name":"CVE-2026-35040","record":{"aliases":["GHSA-3j8v-cgw4-2g6q"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"JavaScript JWT library","requires_auth":"none","summary":"Using stateful RegExp modifiers in fast-jwt validation options causes valid tokens to be rejected, leading to service disruption.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"fast-jwt","vendor":"nearform"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","version":"3.1"},"cwes":[{"id":"CWE-697","name":"Incorrect Comparison"},{"id":"CWE-440","name":"Expected Behavior Violation"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"fast-jwt: Stateful RegExp (/g or /y) causes non-deterministic allowed-claim validation (logical DoS)","id":"CVE-2026-35040","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":2,"n_references":4,"next":{"headline":"ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification","id":"CVE-2026-35041"},"packages":[{"ecosystem":"npm","fixed":["6.2.1"],"introduced":["0"],"last_affected":[],"package":"fast-jwt","purl":null,"source":"GHSA-3j8v-cgw4-2g6q"},{"ecosystem":"npm","fixed":["6.2.1"],"introduced":["0"],"last_affected":[],"package":"fast-jwt","purl":"pkg:npm/fast-jwt","source":"GHSA-3j8v-cgw4-2g6q"}],"prev":{"headline":"fast-jwt: Cache Confusion via cacheKeyBuilder Collisions Can Return Claims From a Different Token (Identity/Authorization Mixup)","id":"CVE-2026-35039"},"products":["fast-jwt"],"published":"2026-04-09","related":[{"cvss_score":9.1,"headline":"fast-jwt has an incomplete fix for CVE-2023-48223: JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key","id":"CVE-2026-34950","kev_date_added":null,"published":"2026-04-06"},{"cvss_score":9.1,"headline":"fast-jwt: Cache Confusion via cacheKeyBuilder Collisions Can Return Claims From a Different Token (Identity/Authorization Mixup)","id":"CVE-2026-35039","kev_date_added":null,"published":"2026-04-06"},{"cvss_score":7.5,"headline":"fast-jwt accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation)","id":"CVE-2026-35042","kev_date_added":null,"published":"2026-04-06"},{"cvss_score":5.9,"headline":"fast-jwt JWT Algorithm Confusion","id":"CVE-2023-48223","kev_date_added":null,"published":"2023-11-20"},{"cvss_score":4.2,"headline":"ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification","id":"CVE-2026-35041","kev_date_added":null,"published":"2026-04-09"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-04-13","vendors":["nearform"]},"summary":"Using stateful RegExp modifiers in fast-jwt validation options causes valid tokens to be rejected, leading to service disruption.","url":"https://insights.sbomify.com/CVE-2026-35040/"}