CVE-2023-48223
Fast-JWT RSA Key Algorithm Confusion Vulnerability
Description
fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to version 3.3.2, the fast-jwt library does not properly prevent JWT algorithm confusion for all public key types. The 'publicKeyPemMatcher' in 'fast-jwt/src/crypto.js' does not properly match all common PEM formats for public keys. To exploit this vulnerability, an attacker needs to craft a malicious JWT token containing the HS256 algorithm, signed with the public RSA key of the victim application. This attack will only work if the victim application utilizes a public key containing the `BEGIN RSA PUBLIC KEY` header. Applications using the RS256 algorithm, a public key with a `BEGIN RSA PUBLIC KEY` header, and calling the verify function without explicitly providing an algorithm, are vulnerable to this algorithm confusion attack which allows attackers to sign arbitrary payloads which will be accepted by the verifier. Version 3.3.2 contains a patch for this issue. As a workaround, change line 29 of `blob/master/src/crypto.js` to include a regular expression.
INFO
Published Date :
Nov. 20, 2023, 6:15 p.m.
Last Modified :
Nov. 21, 2024, 8:31 a.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
3.6
Exploitability Score :
2.2
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2023-48223
.
URL | Resource |
---|---|
https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 | Product |
https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 | Release Notes |
https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg | Exploit Vendor Advisory |
https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 | Product |
https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 | Release Notes |
https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg | Exploit Vendor Advisory |
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2023-48223
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2023-48223
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 Added Reference https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 Added Reference https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Nov. 29, 2023
Action Type Old Value New Value Added CVSS V3.1 NIST AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N Changed Reference Type https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 No Types Assigned https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 Product Changed Reference Type https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 No Types Assigned https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 Release Notes Changed Reference Type https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg No Types Assigned https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg Exploit, Vendor Advisory Added CWE NIST NVD-CWE-noinfo Added CPE Configuration OR *cpe:2.3:a:nearform:fast-jwt:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.3.2 -
CVE Received by [email protected]
Nov. 20, 2023
Action Type Old Value New Value Added Description fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to version 3.3.2, the fast-jwt library does not properly prevent JWT algorithm confusion for all public key types. The 'publicKeyPemMatcher' in 'fast-jwt/src/crypto.js' does not properly match all common PEM formats for public keys. To exploit this vulnerability, an attacker needs to craft a malicious JWT token containing the HS256 algorithm, signed with the public RSA key of the victim application. This attack will only work if the victim application utilizes a public key containing the `BEGIN RSA PUBLIC KEY` header. Applications using the RS256 algorithm, a public key with a `BEGIN RSA PUBLIC KEY` header, and calling the verify function without explicitly providing an algorithm, are vulnerable to this algorithm confusion attack which allows attackers to sign arbitrary payloads which will be accepted by the verifier. Version 3.3.2 contains a patch for this issue. As a workaround, change line 29 of `blob/master/src/crypto.js` to include a regular expression. Added Reference GitHub, Inc. https://github.com/nearform/fast-jwt/security/advisories/GHSA-c2ff-88x2-x9pg [No types assigned] Added Reference GitHub, Inc. https://github.com/nearform/fast-jwt/blob/master/src/crypto.js#L29 [No types assigned] Added Reference GitHub, Inc. https://github.com/nearform/fast-jwt/releases/tag/v3.3.2 [No types assigned] Added CWE GitHub, Inc. CWE-20 Added CVSS V3.1 GitHub, Inc. AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2023-48223
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2023-48223
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.08 }} 0.01%
score
0.36589
percentile