PT-2022-16061 · Npm · Jsonwebtoken

Julienwoll

·

Published

2022-12-22

·

Updated

2026-06-04

·

CVE-2022-23540

CVSS v3.1

6.4

Medium

VectorAV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L
Name of the Vulnerable Software and Affected Versions jsonwebtoken versions <=8.5.1
Description The issue arises from the lack of algorithm definition in the jwt.verify() function, leading to a signature validation bypass due to defaulting to the none algorithm for signature verification. This occurs when no algorithms are specified in the jwt.verify() function and a falsy secret or key is used. Users are affected if they receive a token with no signature, do not specify algorithms, and pass a falsy secret or key.
Recommendations For jsonwebtoken versions <=8.5.1, update to version 9.0.0 to remove the default support for the none algorithm in the jwt.verify() method. If the none algorithm is needed, explicitly specify it in the jwt.verify() options.

Exploit

Fix

Improper Verification of Cryptographic Signature

Improper Authentication

Use of a Broken Cryptographic Algorithm

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2022-23540
GHSA-QWPH-4952-7XR6

Affected Products

Jsonwebtoken