CVE-2026-107722nearform fast-jwt
Authentication bypass via RSA public key misclassification in fast-jwt
Critical 9.8 No auth needed
Follow: this CVE · nearform · nearform fast-jwt We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- —
- Auth required
- No
- Published
- Oct 8, 2026
- Updated
- Oct 13, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-347
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
fast-jwt versions 6.2.0 through 6.3.0 can misclassify RSA public keys as HMAC secrets when non-whitespace content precedes the PEM header. An attacker knowing the public key bytes can sign arbitrary HS256 claims, resulting in authentication or authorization bypass when HS256 is inferred or allowed.
Show the original NVD text
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
Patch available · fixed versions: 6.3.0
Update fast-jwt to version 6.3.0 or later. Alternatively, use an asymmetric-only algorithm allowlist to prevent the attack.
- Apply the vendor's security update for fast-jwt.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | fast-jwt |
≥ 6.2.0 < 6.3.0 |
6.3.0 |
npm install fast-jwt@6.3.0 |
Per OSV / GitHub Advisories (GHSA-ww5h-9m49-7xx4). Check the version in your lockfile before upgrading.
Affected products
- nearform · fast-jwt
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.