Skip to content

jsonwebtoken has insecure input validation in jwt.verify function

High severity GitHub Reviewed Published Dec 21, 2022 in auth0/node-jsonwebtoken • Updated Jan 27, 2023
Withdrawn This advisory was withdrawn on Jan 27, 2023

Package

npm jsonwebtoken (npm)

Affected versions

<= 8.5.1

Patched versions

9.0.0

Description

Overview

For versions <=8.5.1 of jsonwebtoken library, if a malicious actor has the ability to modify the key retrieval parameter (referring to the secretOrPublicKey argument from the readme link) of the jwt.verify() function, they can gain remote code execution (RCE).

Am I affected?

This security issue is a concern when the jsonwebtoken library is used in an insecure way. Users are affected only if they allow untrusted entities to modify the key retrieval parameter of the jwt.verify() on a host that you control. In this scenario, if all the prerequisites are met, the issue may be exploitable. The source of this risk in this scenario would be in the calling code, and not in the library itself.

How do I fix it?

Users of jsonwebtoken 8.5.1 and earlier are encouraged to update to the latest version, 9.0.0, which presents safer code and important security checks that fixes this security flaw and others and prevents misuse of the package.

References

@julienwoll julienwoll published to auth0/node-jsonwebtoken Dec 21, 2022
Published by the National Vulnerability Database Dec 21, 2022
Published to the GitHub Advisory Database Dec 22, 2022
Reviewed Dec 22, 2022
Withdrawn Jan 27, 2023
Last updated Jan 27, 2023

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L

Weaknesses

CVE ID

CVE-2022-23529

GHSA ID

GHSA-27h2-hvpr-p74q
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.