CVE-2022-23541
jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.0
jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC
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.
- Record
CVE-2022-23541- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-287, CWE-1259
- Updated
- 2026-11-02
EUVDEUVD-2022-7650
5.0
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.
- Record
EUVD-2022-7650- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-hjrf-2m68-5959
5.0
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
- Record
GHSA-hjrf-2m68-5959- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-287, CWE-1259
- Updated
- 2026-11-02
NVD
5.0
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.
- Record
CVE-2022-23541- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - CVSS 3.1
- 6.3 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-287, CWE-1259
- Updated
- 2026-11-02
OSV
5.0
jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC
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.
- Record
CVE-2022-23541- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-1259, CWE-287
- Updated
- 2026-11-02
OSVGHSA-hjrf-2m68-5959
5.0
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
- Record
GHSA-hjrf-2m68-5959- CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L - Weakness
- CWE-1259, CWE-287
- Updated
- 2026-11-02
Show 6 moreShow less
OSVCLSA-2026-1774657372 No score
TuxCare security update for jsonwebtoken (3 CVEs)
TuxCare rebuilt jsonwebtoken to address 3 CVEs. Fixed in 8.5.1-tuxcare.1.
- Record
CLSA-2026-1774657372- Updated
- 2026-11-02
OSVCLSA-2026-1776818208 No score
TuxCare security update for jsonwebtoken (3 CVEs)
TuxCare rebuilt jsonwebtoken to address 3 CVEs. Fixed in 0.4.1-tuxcare.3.
- Record
CLSA-2026-1776818208- Updated
- 2026-11-02
OSVCLSA-2026-1786361774 No score
TuxCare security update for jsonwebtoken (2 CVEs)
TuxCare rebuilt jsonwebtoken to address 2 CVEs. Fixed in 5.4.0-tuxcare.1.
- Record
CLSA-2026-1786361774- Updated
- 2026-11-02
OSVCLSA-2026-1787321999 No score
TuxCare security update for jsonwebtoken (2 CVEs)
TuxCare rebuilt jsonwebtoken to address 2 CVEs. Fixed in 0.4.0-tuxcare.7.
- Record
CLSA-2026-1787321999- Updated
- 2026-11-02
OSVCLSA-2026-1787322010 No score
TuxCare security update for jsonwebtoken (3 CVEs)
TuxCare rebuilt jsonwebtoken to address 3 CVEs. Fixed in 0.3.0-tuxcare.3.
- Record
CLSA-2026-1787322010- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2022-23541 No score
CVE-2022-23541 in jsonwebtoken - Patched by Root
Root has patched CVE-2022-23541 in the jsonwebtoken package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2022-23541- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
jsonwebtokennpm |
through 8.5.1 | 9.0.0 |
jsonwebtokenTuxCare:npm From an advisory covering 3 CVEs |
8.5.1-tuxcare.0 up to 8.5.1-tuxcare.1, plus listed versions 8.5.1 |
8.5.1-tuxcare.1 |
jsonwebtokenTuxCare:npm From an advisory covering 3 CVEs |
0.4.1-tuxcare.0 up to 0.4.1-tuxcare.3, plus listed versions 0.4.10.4.1-tuxcare.10.4.1-tuxcare.2 |
0.4.1-tuxcare.3 |
jsonwebtokenTuxCare:npm From an advisory covering 2 CVEs |
5.4.0-tuxcare.0 up to 5.4.0-tuxcare.1, plus listed versions 5.4.0 |
5.4.0-tuxcare.1 |
jsonwebtokenTuxCare:npm From an advisory covering 2 CVEs |
0.4.0-tuxcare.0 up to 0.4.0-tuxcare.7, plus listed versions 0.4.00.4.0-tuxcare.10.4.0-tuxcare.20.4.0-tuxcare.30.4.0-tuxcare.40.4.0-tuxcare.50.4.0-tuxcare.6 |
0.4.0-tuxcare.7 |
jsonwebtokenTuxCare:npm From an advisory covering 3 CVEs |
0.3.0-tuxcare.0 up to 0.3.0-tuxcare.3, plus listed versions 0.3.00.3.0-tuxcare.10.3.0-tuxcare.2 |
0.3.0-tuxcare.3 |
jsonwebtokennpm |
before 9.0.0 | 9.0.0 |
jsonwebtokenRoot:npm |
before 8.2.0-aikido.2 | 8.2.0-aikido.28.5.1-aikido.48.5.1-aikido.58.2.0-aikido.3 |
@rootio/jsonwebtokenRoot:npm |
before 8.5.1-root.io.2 | 8.5.1-root.io.28.5.1-root.io.38.2.0-root.io.18.2.0-root.io.28.5.1-root.io.48.5.1-root.io.58.2.0-root.io.3 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-23541 is a medium vulnerability (CVSS 5.0) in Auth0 Jsonwebtoken, published December 22, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.81%, the 57th percentile. Fixed in jsonwebtoken 9.0.0.
References
github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-hjrf-2m68-5959
github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3
github.com/auth0/node-jsonwebtoken/releases/tag/v9.0.0
security.netapp.com/advisory/ntap-20240621-0007
nvd.nist.gov/vuln/detail/CVE-2022-23541
github.com/advisories/GHSA-hjrf-2m68-5959
github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23541.json
github.com/auth0/node-jsonwebtoken