Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS04Y2Y3LTMyZ3ctd3IzM84AAwgf

jsonwebtoken unrestricted key type could lead to legacy keys usage

Overview

Versions <=8.5.1 of jsonwebtoken library could be misconfigured so that legacy, insecure key types are used for signature verification. For example, DSA keys could be used with the RS256 algorithm.

Am I affected?

You are affected if you are using an algorithm and a key type other than the combinations mentioned below

Key type algorithm
ec ES256, ES384, ES512
rsa RS256, RS384, RS512, PS256, PS384, PS512
rsa-pss PS256, PS384, PS512

And for Elliptic Curve algorithms:

alg Curve
ES256 prime256v1
ES384 secp384r1
ES512 secp521r1

How do I fix it?

Update to version 9.0.0. This version validates for asymmetric key type and algorithm combinations. Please refer to the above mentioned algorithm / key type combinations for the valid secure configuration. After updating to version 9.0.0, If you still intend to continue with signing or verifying tokens using invalid key type/algorithm value combinations, you’ll need to set the allowInvalidAsymmetricKeyTypes option to true in the sign() and/or verify() functions.

Will the fix impact my users?

There will be no impact, if you update to version 9.0.0 and you already use a valid secure combination of key type and algorithm. Otherwise, use the allowInvalidAsymmetricKeyTypes option to true in the sign() and verify() functions to continue usage of invalid key type/algorithm combination in 9.0.0 for legacy compatibility.

Permalink: https://github.com/advisories/GHSA-8cf7-32gw-wr33
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04Y2Y3LTMyZ3ctd3IzM84AAwgf
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 1 year ago
Updated: about 1 year ago


Identifiers: GHSA-8cf7-32gw-wr33, CVE-2022-23539
References: Repository: https://github.com/auth0/node-jsonwebtoken
Blast Radius: 0.0

Affected Packages

npm:jsonwebtoken
Dependent packages: 21,931
Dependent 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