PT-2023-30740

CVE-2023-48223

·

تاريخ النشر

2023-11-20

·

تاريخ التحديث

2026-10-01

الوصف من

CVSS 3.1
5.9
متوسطة
المقاييسAV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Name of the Vulnerable Software and Affected Versions fast-jwt versions prior to 3.3.2
Description 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 issue, 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.
Recommendations For versions prior to 3.3.2, update to version 3.3.2 to resolve the issue. As a temporary workaround, change line 29 of fast-jwt/src/crypto.js to include a regular expression: const publicKeyPemMatcher = /^-----BEGIN( RSA)? PUBLIC KEY-----/. Restrict access to the verify function to minimize the risk of exploitation until the issue is resolved.
قابلية الاستغلال
استغلال
إصلاح
التأثيرات
الباحثون
المورّدون
المنتجات المتأثرة
تصنيف نقاط الضعف
المعرّفات ذات الصلة
GHSA-C2FF-88X2-X9PG
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾