Skip to content
Fencer Vulns
medium 5.0

CVE-2022-23541 json

jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC

published 2022-12-22 3 y ago modified 2026-06-17 4 mo ago also GHSA-hjrf-2m68-5959 , EUVD-2022-7650

cvss
5.0
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.8%
EPSS 0.8% chance of exploitation in 30 days, percentile 57%
public exploits
0
none known

Summary

jsonwebtoken is an implementation of JSON Web Tokens. 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, other 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. If your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function. This issue has been patched, please update to version 9.0.0.

Patch / fix

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2022-23541 updated cvss 5.0

jsonwebtoken: Insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC

  • Red Hat OpenShift Container Platform 4 openshift4/ose-console
    affected: no fix available
  • Red Hat Openshift Container Storage 4 ocs4/mcg-core-rhel8
    affected: no fix planned “Out of support scope”
  • Red Hat RHODF 4.13 for RHEL 9 odf4/mcg-core-rhel9 v4.13.0-41
    fixed: vendor fix RHSA-2023:3742
  • Red Hat RHODF 4.13 for RHEL 9 odf4/cephcsi-rhel9 v4.13.0-35, odf4/mcg-cli-rhel9 v4.13.0-17, odf4/odf-console-rhel9 v4.13.0-85, odf4/mcg-rhel9-operator v4.13.0-41, odf4/ocs-rhel9-operator v4.13.0-67, odf4/odf-rhel9-operator v4.13.0-24, +17 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

0.81% chance of exploitation in the next 30 days, higher than 57% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 5.0 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
NVD 3.1 6.3 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
GitHub 3.1 5.0 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

Affected packages

ecosystem package affected fixed in
npm jsonwebtoken
<9.0.0
9.0.0

Affected products

  • auth0 node-jsonwebtoken

Classification

Weakness
  • CWE-287 Improper Authentication
  • CWE-1259 Improper Restriction of Security Token Assignment

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.