JWT Algorithm Confusion in json-web-token library
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-345.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| joaquimserafim | json-web-token | before 4.0.0 | 4.0.0 | Patch available | CNA |
| — | json-web-token (npm) | before 4.0.0 | 4.0.0 | Patch available | GHSA-4xw9-cx39-r355 |
- json-web-token Vendorjoaquimserafim Affected before 4.0.0 Fixed in 4.0.0 Patch available CNA
- json-web-token (npm) Vendor— Affected before 4.0.0 Fixed in 4.0.0 Patch available GHSA-4xw9-cx39-r355
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:joaquimserafim:json_web_token:*:*:*:*:*:node.js:*:* | before 3.1.1 | Vulnerable | joaquimserafim |
- cpe:2.3:a:joaquimserafim:json_web_token:*:*:*:*:*:node.js:*:* Versions before 3.1.1 Vulnerable ·joaquimserafim
Remediation
- Fix · CNA json-web-token (joaquimserafim) Fixed in 4.0.0
- Fix · GHSA-4xw9-cx39-r355 json-web-token (npm) Fixed in 4.0.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-48238
- 2026-10-03 Alias added: GHSA-4xw9-cx39-r355
- 2026-10-20 Affected versions changed · GHSA-4xw9-cx39-r355
References
Sources
- CVE-2023-48238 · CVE Program
- CVE-2023-48238 · NVD
- FIRST EPSS
- GHSA-4xw9-cx39-r355 · 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