Read the docs
TI-2023-26102 Aliases CVE-2023-48238GHSA-4xw9-cx39-r355

JWT Algorithm Confusion in json-web-token library

Priority HIGH 72CWE-345Published · Updated

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

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00312 24th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed json-web-token (joaquimserafim): 4.0.0json-web-token (npm): 4.0.0

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

VendorProductAffected versionsFixed inStatusSource
joaquimserafimjson-web-tokenbefore 4.0.04.0.0Patch availableCNA
—json-web-token (npm)before 4.0.04.0.0Patch availableGHSA-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

CPEVersionsRoleVendor
cpe:2.3:a:joaquimserafim:json_web_token:*:*:*:*:*:node.js:*:*before 3.1.1Vulnerablejoaquimserafim
  • 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

  1. 2026-10-02 Threatist record created from CVE-2023-48238
  2. 2026-10-03 Alias added: GHSA-4xw9-cx39-r355
  3. 2026-10-20 Affected versions changed · GHSA-4xw9-cx39-r355

References

Sources