Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1oanJmLTJtNjgtNTk1Oc4AAwgh
jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC
Overview
Versions <=8.5.1
of jsonwebtoken
library can be misconfigured so that passing a poorly implemented key retrieval function (referring to the secretOrPublicKey
argument from the readme link) will result in incorrect verification of tokens. There is a possibility of using a different algorithm and key combination in verification than the one that was used to sign the tokens. Specifically, tokens signed with an asymmetric public key could be verified with a symmetric HS256 algorithm. This can lead to successful validation of forged tokens.
Am I affected?
You will be affected if your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function.
How do I fix it?
Update to version 9.0.0.
Will the fix impact my users?
There is no impact for end users
Permalink: https://github.com/advisories/GHSA-hjrf-2m68-5959JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1oanJmLTJtNjgtNTk1Oc4AAwgh
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 1 year ago
Updated: about 1 year ago
CVSS Score: 5.0
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
Identifiers: GHSA-hjrf-2m68-5959, CVE-2022-23541
References:
- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-hjrf-2m68-5959
- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3
- https://nvd.nist.gov/vuln/detail/CVE-2022-23541
- https://github.com/auth0/node-jsonwebtoken/releases/tag/v9.0.0
- https://github.com/advisories/GHSA-hjrf-2m68-5959
Blast Radius: 29.3
Affected Packages
npm:jsonwebtoken
Dependent packages: 21,931Dependent repositories: 718,942
Downloads: 64,390,339 last month
Affected Version Ranges: <= 8.5.1
Fixed in: 9.0.0
All affected versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.4.1, 1.0.0, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.3.0, 2.0.0, 3.0.0, 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.2.2, 4.0.0, 4.1.0, 4.2.0, 4.2.1, 4.2.2, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.1.0, 5.2.0, 5.3.1, 5.4.0, 5.4.1, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.6.0, 5.6.2, 5.7.0, 6.0.0, 6.0.1, 6.1.0, 6.1.1, 6.1.2, 6.2.0, 7.0.0, 7.0.1, 7.1.0, 7.1.1, 7.1.3, 7.1.5, 7.1.6, 7.1.7, 7.1.8, 7.1.9, 7.1.10, 7.2.0, 7.2.1, 7.3.0, 7.4.0, 7.4.1, 7.4.2, 7.4.3, 8.0.0, 8.0.1, 8.1.0, 8.1.1, 8.2.0, 8.2.1, 8.2.2, 8.3.0, 8.4.0, 8.5.0, 8.5.1
All unaffected versions: 9.0.0, 9.0.1, 9.0.2