Incomplete fix in fast-jwt enables RSA to HS256 algorithm confusion
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-347.
Summary
fast-jwt from 6.2.0 before 6.3.0 can treat RSA public key text as an HMAC secret. Non-whitespace content before the PEM header stops key detection and falls back to HMAC (CWE-347). A remote attacker who knows the public key can forge HS256 tokens when HS256 is inferred or allowed, bypassing authentication or authorization.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| nearform | fast-jwt | 6.2.0 to before 6.3.0 | 6.3.0 | Patch available | CNA |
| — | fast-jwt (npm) | 6.2.0 to before 6.3.0 | 6.3.0 | Patch available | GHSA-ww5h-9m49-7xx4 |
- fast-jwt Vendornearform Affected 6.2.0 to before 6.3.0 Fixed in 6.3.0 Patch available CNA
- fast-jwt (npm) Vendor— Affected 6.2.0 to before 6.3.0 Fixed in 6.3.0 Patch available GHSA-ww5h-9m49-7xx4
Remediation
Upgrade the npm package fast-jwt to version 6.3.0, which fixes this issue. Until the upgrade, an asymmetric-only algorithm allowlist prevents the attack.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · CNA fast-jwt (nearform) Fixed in 6.3.0
- Fix · GHSA-ww5h-9m49-7xx4 fast-jwt (npm) Fixed in 6.3.0 Advisory →
Timeline
- 2026-10-09 Threatist record created from CVE-2026-107722
- 2026-10-09 Alias added: GHSA-ww5h-9m49-7xx4
- 2026-10-13 CISA SSVC decision points changed
- 2026-10-13 Priority changed: MEDIUM → HIGH
References
Other 5
More nearform vulnerabilities
- TI-2026-27174 fast-jwt has an incomplete fix for CVE-2023-48223: JWT Algorithm Confusion via Whitespace-Prefixed RSA Public Key CVSS 3.1CRITICAL 9.1
- TI-2025-37324 get-jwks poisoned JWKS cache allows post-fetch issuer validation bypass CVSS 3.0CRITICAL 9.4
- TI-2026-27245 fast-jwt accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation) CVSS 3.1HIGH 7.5
- TI-2026-69684 Claim validator bypass in fast-jwt when JWT payload is a JSON array CVSS 3.1HIGH 8.1
- TI-2026-69695 fast-jwt accepts public JWK JSON as HMAC key, enabling token forgery CVSS 3.1HIGH 7.4
- TI-2026-69689 fast-jwt accepts unsigned JWTs when the key is empty or null CVSS 3.1HIGH 7.4
Sources
- CVE-2026-107722 · CVE Program
- CVE-2026-107722 · NVD
- FIRST EPSS
- GHSA-ww5h-9m49-7xx4 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences