fast-jwt: createVerifier accepts unsigned JWTs when key is '' or null and algorithms is explicitly set
nearform fast-jwt
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| fast-jwt npm |
|
|
Original description
fast-jwt provides fast JSON Web Token (JWT) implementation. Prior to 6.3.1, fast-jwt createVerifier accepts an unsigned JWT when key is an empty string or null and algorithms is a non-empty allowlist. Falsy synchronous keys bypass prepareKeyOrSecret, allowedAlgorithms remains active, hasKey is false, and the empty signature avoids the verifySignature gate. An attacker can therefore submit a token containing arbitrary claims without possessing a signing key, resulting in authentication or authorization bypass. Claim validators still run, and non-empty keys, an empty key without algorithms, and the async key resolver path do not have this behavior. This issue is fixed in version 6.3.1.
From the CVE record · GitHub_M