Improper Authentication Affecting jsonwebtoken package, versions <9.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.09% (40th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Authentication vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-JSONWEBTOKEN-3180022
  • published22 Dec 2022
  • disclosed22 Dec 2022
  • creditUnknown

Introduced: 22 Dec 2022

CVE-2022-23540  (opens in a new tab)
CWE-287  (opens in a new tab)

How to fix?

Upgrade jsonwebtoken to version 9.0.0 or higher.

Overview

jsonwebtoken is a JSON Web Token implementation (symmetric and asymmetric)

Affected versions of this package are vulnerable to Improper Authentication such that the lack of algorithm definition in the jwt.verify() function can lead to signature validation bypass due to defaulting to the none algorithm for signature verification.

Exploitability

Users are affected only if all of the following conditions are true for the jwt.verify() function:

  1. A token with no signature is received.

  2. No algorithms are specified.

  3. A falsy (e.g., null, false, undefined) secret or key is passed.

CVSS Scores

version 3.1