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
Description
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
Overview
For versions
<=8.5.1
ofjsonwebtoken
library, if a malicious actor has the ability to modify the key retrieval parameter (referring to thesecretOrPublicKey
argument from the readme link) of thejwt.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 thejwt.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