Vulnerability · Published Dec 22, 2022 · Assigned by GitHub_M
CVE-2022-23539jsonwebtoken unrestricted key type could lead to legacy keys usage
Medium 5.9
In plain English
A medium-severity broken cryptography in node-jsonwebtoken from auth0. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 45% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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. You are affected if you are using an algorithm and a key type other than a combination listed in the GitHub Security Advisory as unaffected. This issue has been fixed, please 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | jsonwebtoken | 9.0.0 | GHSA-8cf7-32gw-wr33 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| auth0 | node-jsonwebtoken | <= 8.5.1 |
Weakness: CWE-327 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:N