{"cve":"CVE-2023-48223","nvd":{"published":"2023-11-20T18:15:07.047","modified":"2026-06-17T06:33:46.483","status":"Modified","description":"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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9},"cwes":["CWE-20"],"references":["https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29","https://github.com/nearform/fast-jwt/releases/tag/v3.3.2","https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg","https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29","https://github.com/nearform/fast-jwt/releases/tag/v3.3.2"],"products":["nearform:fast-jwt"],"source":"nvd","synced_at":"2026-10-19T21:42:07.670898610+00:00"},"epss":{"cve":"CVE-2023-48223","score":0.00681,"percentile":0.52472,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-c2ff-88x2-x9pg","url":"https://osv.dev/vulnerability/GHSA-c2ff-88x2-x9pg","summary":"JWT Algorithm Confusion","modified":"2023-11-20T21:12:09.610221Z","packages":[{"ecosystem":"npm","name":"fast-jwt","purl":"pkg:npm/fast-jwt","ranges":["<3.3.2"],"fixed":["3.3.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}