CVE-2023-48238 json
JWT Algorithm Confusion in json-web-token library
published 2023-11-17 2 y ago modified 2026-10-19 20 d ago also GHSA-4xw9-cx39-r355 , EUVD-2023-2883
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 24%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm json-web-token 4.0.0
- joaquimserafim json_web_token 3.1.1
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.31% chance of exploitation in the next 30 days, higher than 24% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/joaquimserafim/json-web-token/security/advisories/GHSA-4xw9-cx39-r355 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | json-web-token | <4.0.0 |
4.0.0 |
Affected products
- joaquimserafim json-web-token
Classification
References
-
github.com
/joaquimserafim/json-web-token/commit/b6e56b1346f48432d29133c76b65222ad93956b7
web
-
github.com
/joaquimserafim/json-web-token/security/advisories/GHSA-4xw9-cx39-r355
web, exploit, vendor-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2023-48238
advisory
-
github.com
/joaquimserafim/json-web-token
package
-
github.com
/joaquimserafim/json-web-token/blob/acf6a462471e1b14187eb77414e9161b8b7bff7e/index.js#L86
web
Sources
- CVE List CVE-2023-48238
- GitHub Advisory GHSA-4xw9-cx39-r355
- NVD CVE-2023-48238
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.