{"id":"CVE-2026-107722","published":"2026-10-08T22:17:28.447","lastModified":"2026-10-13T17:17:16.970","description":"fast-jwt provides fast JSON Web Token (JWT) implementation. From 6.2.0 until 6.3.0, fast-jwt can misclassify RSA public-key text as an HMAC secret when the key has non-whitespace content before its PEM header. In src/crypto.js, performDetectPublicKeyAlgorithms trims whitespace but publicKeyPemMatcher remains start-anchored, so comments, control characters, zero-width characters, or wrapper text can prevent PEM detection and reach the HMAC fallback. An attacker who knows the public key bytes can sign arbitrary HS256 claims with that public material when HS256 is inferred or allowed, resulting in authentication or authorization bypass. An asymmetric-only algorithm allowlist prevents the attack. This issue is fixed in version 6.3.0.","cvssScore":9.8,"cvssSeverity":"CRITICAL","cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cwes":["CWE-347"],"vendors":[],"products":[],"references":[{"url":"https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa","tags":[]},{"url":"https://github.com/nearform/fast-jwt/pull/632","tags":[]},{"url":"https://github.com/nearform/fast-jwt/releases/tag/v6.3.0","tags":[]},{"url":"https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4","tags":[]},{"url":"https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4","tags":[]}],"exploitRefs":[{"url":"https://github.com/nearform/fast-jwt/commit/d96bbc6c5336055a6dbfa318fdbab01197264cfa","tags":[]},{"url":"https://github.com/nearform/fast-jwt/pull/632","tags":[]},{"url":"https://github.com/nearform/fast-jwt/releases/tag/v6.3.0","tags":[]},{"url":"https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4","tags":[]},{"url":"https://github.com/nearform/fast-jwt/security/advisories/GHSA-ww5h-9m49-7xx4","tags":[]}],"hasPoc":true,"ai":{"summary":"The flaw allows an attacker to misclassify RSA public keys as HMAC secrets, enabling them to sign JWTs with the public key, leading to authentication or authorization bypass.","exploitability":"Exploitation requires knowledge of the public key bytes and the ability to manipulate the key content. The attack is moderately hard to exploit due to the need for precise key manipulation.","blast_radius":"If exploited, this could lead to unauthorized access or privilege escalation, impacting the security of the application and potentially the entire system.","remediation":"Upgrade to fast-jwt version 6.3.0 or later.","detection":"No reliable host or network indicator is derivable from the published description.","tags":["auth-bypass","jwt","rsa","hmac"],"model":"qwen2.5:7b-instruct","analyzedAt":"2026-10-09T08:43:17.192Z"}}