CVE-2026-107724 · GHSA-g3jj-5cmm-3hxx
fast-jwt treats raw public JWK JSON as an HMAC secret, enabling HS256 token forgery
- Risk score
- 57/100
- CVSS
- 7.4 v3.1
- Exploit chance (30 days)
- 0.2%
- Published
- 8 Oct 2026
Open in the live forecast Today's forecast
What to know
- What it is
- fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.2.4, fast-jwt can classify raw serialized public JWK or JWKS JSON as an HMAC secret because src/crypto.js performDetectPublicKeyAlgorithms treats non-PEM strings as symmetric key material. If HS256 is explicitly allowed or inferred, an attacker who knows…
- Affected
- fast-jwt (npm) = 6.2.4
- Fix
- Upgrade fast-jwt to 6.3.0 or later.
- Exploitation
- No known exploitation
Story map
At a glance
fast-jwt: Amber, patch this week. 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-anc…
The flaws
- CVE-2026-107724: Fast-jwt treats raw public JWK JSON as an HMAC secret, enabling HS256 token forgery (CVSS 7.4 · EPSS 0%)
- CVE-2026-107722: Incomplete patch of CVE-2026-34950: Non-whitespace key-prefix re-enables RSA→HS256 algorithm confusion (CVSS 9.8 · EPSS 0%)
- CVE-2026-107723: Fast-jwt : Silent claim-validator bypass when JWT payload is a JSON array (CVSS 8.1 · EPSS 0%)
- CVE-2026-107720: CreateVerifier accepts unsigned JWTs when key is '' or null and algorithms is explicitly set (CVSS 7.4 · EPSS 0%)
The fix
Upgrade fast-jwt: 6.3.0 · 6.3.1 or later on your release line
Who is exposed: fast-jwt (npm) >= 6.2.0, <= 6.2.4
Where it stands
- No known exploitation
Connects to
- Same weakness: CWE-347 (CWE-347). 66 other warnings in 30 days
Why it is Yellow
- CVSS 7.4 high
- Remotely exploitable without logging in
- On your watchlist: npm
Affected packages
| Package | Ecosystem | Vulnerable | Fixed in |
|---|---|---|---|
| fast-jwt | npm | = 6.2.4 | 6.3.0 |
References
- https://github.com/advisories/GHSA-g3jj-5cmm-3hxx
- https://github.com/nearform/fast-jwt/security/advisories/GHSA-g3jj-5cmm-3hxx
- https://github.com/nearform/fast-jwt/pull/636
- https://github.com/nearform/fast-jwt/commit/10f9591349199ed2ab9fa1748ce92cdca697f6cf
- https://github.com/nearform/fast-jwt/releases/tag/v6.3.0
- https://github.com/advisories/GHSA-g3jj-5cmm-3hxx
Original description
fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.2.4, fast-jwt can classify raw serialized public JWK or JWKS JSON as an HMAC secret because src/crypto.js performDetectPublicKeyAlgorithms treats non-PEM strings as symmetric key material. If HS256 is explicitly allowed or inferred, an attacker who knows the exact serialized public-key bytes can use those bytes as an HMAC key and create a token containing arbitrary claims that createVerifier accepts. Serialization ordering or whitespace differences can prevent exploitation, and applications using supported PEM keys with an asymmetric-only algorithm allowlist are not affected. This issue is fixed in version 6.3.0.
Last activity 8 Oct 2026. Patch Forecast updates every hour.