fast-jwt JWT Algorithm Confusion
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to version 3.3.2, the fast-jwt library does not properly prevent JWT algorithm confusion for all public key types. The 'publicKeyPemMatcher' in 'fast-jwt/src/crypto.js' does not properly match all common PEM formats for public keys. To exploit this vulnerability, an attacker needs to craft a malicious JWT token containing the HS256 algorithm, signed with the public RSA key of the victim application. This attack will only work if the victim application utilizes a public key containing the `BEGIN RSA PUBLIC KEY` header. Applications using the RS256 algorithm, a public key with a `BEGIN RSA PUBLIC KEY` header, and calling the verify function without explicitly providing an algorithm, are vulnerable to this algorithm confusion attack which allows attackers to sign arbitrary payloads which will be accepted by the verifier. Version 3.3.2 contains a patch for this issue. As a workaround, change line 29 of `blob/master/src/crypto.js` to include a regular expression.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| nearform | fast-jwt | before 3.3.2 | 3.3.2 | Patch available | CNA |
| — | fast-jwt (npm) | before 3.3.2 | 3.3.2 | Patch available | GHSA-c2ff-88x2-x9pg |
- fast-jwt Vendornearform Affected before 3.3.2 Fixed in 3.3.2 Patch available CNA
- fast-jwt (npm) Vendor— Affected before 3.3.2 Fixed in 3.3.2 Patch available GHSA-c2ff-88x2-x9pg
Remediation
- Fix · CNA fast-jwt (nearform) Fixed in 3.3.2
- Fix · GHSA-c2ff-88x2-x9pg fast-jwt (npm) Fixed in 3.3.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-48223
- 2026-10-03 Alias added: GHSA-c2ff-88x2-x9pg
References
More nearform Fast-jwt 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-2026-27245 fast-jwt accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation) CVSS 3.1HIGH 7.5
- TI-2026-27243 fast-jwt: Stateful RegExp (/g or /y) causes non-deterministic allowed-claim validation (logical DoS) CVSS 3.1MEDIUM 5.3
- TI-2026-27244 ReDoS in fast-jwt when using RegExp in allowed* leading to CPU exhaustion during token verification CVSS 3.1MEDIUM 6.5
- TI-2026-27242 Insufficient verification of data authenticity in nearform fast-jwt CVSS 3.1CRITICAL 9.1
Sources
- CVE-2023-48223 · CVE Program
- CVE-2023-48223 · NVD
- FIRST EPSS
- GHSA-c2ff-88x2-x9pg · 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