# CVE-2023-48238: JWT Algorithm Confusion in json-web-token library

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.39%, higher than 34% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-11-17T21:35:00.111Z
- Modified: 2026-10-19T20:00:04.713Z
- Also known as: GHSA-4xw9-cx39-r355
- Weaknesses: CWE-20, CWE-345
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

joaquimserafim/json-web-token is a javascript library use to interact with JSON Web Tokens (JWT) which are a compact URL-safe means of representing claims to be transferred between two parties. Versions prior to 4.0.0 are vulnerable to a JWT algorithm confusion attack. On line 86 of the 'index.js' file, the algorithm to use for verifying the signature of the JWT token is taken from the JWT token, which at that point is still unverified and thus shouldn't be trusted. 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 against this library is the RS256 algorithm is in use, however it is a best practice to use that algorithm. Version 4.0.0 fixes the issue.

(As written by CVE List.)

## Affected

- joaquimserafim json-web-token: < 4.0.0
- json-web-token (npm): before 4.0.0
- joaquimserafim json_web_token: before 3.1.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://github.com/joaquimserafim/json-web-token/security/advisories/GHSA-4xw9-cx39-r355> (exploit, vendor-advisory, web)
- <https://github.com/joaquimserafim/json-web-token/commit/b6e56b1346f48432d29133c76b65222ad93956b7> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-48238> (advisory)
- <https://github.com/joaquimserafim/json-web-token> (package)
- <https://github.com/joaquimserafim/json-web-token/blob/acf6a462471e1b14187eb77414e9161b8b7bff7e/index.js#L86> (web)

## Sources

- CVE List: [CVE-2023-48238](https://www.cve.org/CVERecord?id=CVE-2023-48238), CVE Terms of Use, modified 2026-06-08
- GitHub Advisory Database: [GHSA-4xw9-cx39-r355](https://github.com/advisories/GHSA-4xw9-cx39-r355), CC-BY-4.0, modified 2026-10-19
- NVD: [CVE-2023-48238](https://nvd.nist.gov/vuln/detail/CVE-2023-48238), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-48238 · Whole record: https://cve.day/CVE-2023-48238.json · Rebuilt by cve.day 2026-11-25T22:58:30.586Z
