{"id":"CVE-2022-23541","published":"2022-12-22T17:52:22Z","modified":"2025-02-13T16:32:22Z","title":"jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from…","vendor":"auth0","product":"node-jsonwebtoken","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0081,"percentile":0.57807,"provenance":"source"},"cwes":[{"id":"CWE-287","name":"Improper Authentication"},{"id":"CWE-1259","name":"Improper Restriction of Security Token Assignment"}],"references":[{"url":"https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-hjrf-2m68-5959","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3","tags":["x_refsource_MISC"]},{"url":"https://github.com/auth0/node-jsonwebtoken/releases/tag/v9.0.0","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20240621-0007/","tags":[]}],"priority":{"score":15.1,"factors":[{"name":"EPSS percentile","points":11.56},{"name":"CVSS severity","points":3.5}]},"vendorSlug":"auth0","affectedVersions":[{"vendor":"auth0","product":"node-jsonwebtoken","versions":["<= 8.5.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-07-03T17:50:35.348040Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"jsonwebtoken","vulnerableRanges":["<9.0.0"],"patched":["9.0.0"],"from":["GHSA-hjrf-2m68-5959"],"provenance":"source"}],"summary":{"text":"A flaw in the node-jsonwebtoken library's key retrieval handling, which is part of the jsonwebtoken implementation of JSON Web Tokens, allows tokens to be verified with a different algorithm and key combination than the one used to sign them. An attacker with network access and low privileges can forge tokens, for example by verifying tokens signed with an asymmetric public key using the symmetric HS256 algorithm, but only where the application accepts both symmetric and asymmetric keys in jwt.verify() through the same key retrieval function, and user interaction is not required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:35:39Z"},"euvd":{"id":"EUVD-2022-7650","exploited":false,"provenance":"source"}}