fast-jwt is vulnerable to Authentication Bypass
98
Critical Risk
fast-jwt detects PEM-encoded asymmetric keys by trimming the key and matching a -----BEGIN PUBLIC KEY----- header anchored at the start of the string. Because trimming only removes whitespace, a key carrying any non-whitespace leading bytes (control characters, zero-width unicode, comment or wrapper text) fails the anchored match and falls through to the HMAC verification path, where the public RSA key is used as the HMAC shared secret. As the verification key is public, an attacker can forge an HS256 token keyed with it and have the signature accepted, bypassing verification. The fix locates the PEM header wherever it appears and refuses to use any key containing PEM markers as an HMAC secret.
You are affected if you are using a version that falls within the vulnerable range and your application verifies tokens without an algorithms allowlist while loading its verification key from a source that may prepend non-whitespace bytes.
fast-jwt is vulnerable to Authentication Bypass in versions 6.2.0 - 6.2.4.
Upgrade the fast-jwt library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant