Insufficient Session Expirationfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Insufficient Session Expiration in src/verifier.js when the clockTimestamp, clockTolerance, or cacheTTL verifier options are set to non-finite values such as Infinity or NaN. The previous validation used a truthy guard (x && ...) and checked only that the value was a non-negative number, so Infinity passed validation and disabled exp/nbf claim enforcement entirely, while NaN bypassed the truthy check and also went undetected. An attacker who can control these verifier options can cause token expiry and not-before checks to be silently skipped, allowing expired or not-yet-valid tokens to be accepted as valid.
How to fix Insufficient Session Expiration? Upgrade fast-jwt to version 6.3.0 or higher.
| |
Improper Validation of Specified Type of Inputfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input via the decode function in src/decoder.js, where a JWT with a JSON array as its payload passes the object type check because typeof [] === 'object' in JavaScript. As a result, every configured claim validator (exp, nbf, iss, aud, sub, jti, nonce) is silently skipped for array-shaped payloads, because the claim in payload guard always returns false for arrays. An authenticated attacker can forge a token with an array payload to bypass all claim validation and gain unauthorized access.
How to fix Improper Validation of Specified Type of Input? Upgrade fast-jwt to version 6.3.0 or higher.
| |
Insufficient Session Expirationfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Insufficient Session Expiration via the verifier cache in src/verifier.js, where the cacheSet function only derived exp and nbf bounds from a token's payload when the iat claim was also present. An attacker can present a token that lacks iat to bypass expiration enforcement: the token is cached until the cacheTTL bound rather than until exp, and the nbf lower bound is also not applied, allowing an expired or not-yet-valid token to be accepted on subsequent cached lookups.
Note: This is only exploitable when the verifier cache is enabled and the presented JWT omits the iat claim.
How to fix Insufficient Session Expiration? Upgrade fast-jwt to version 6.3.4 or higher.
| |
Improper Verification of Cryptographic Signaturefast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via createVerifier in src/verifier.js, when an empty string or null is passed as the key option. Because the falsy-key branch skipped key preparation, a caller-supplied algorithms allowlist remained active with no key to check against. verifyToken then saw neither a key nor a signature and accepted forged, unsigned tokens as valid, allowing an attacker to bypass signature verification entirely by presenting an unsigned JWT.
How to fix Improper Verification of Cryptographic Signature? Upgrade fast-jwt to version 6.3.1 or higher.
| |
Improper Authenticationfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Improper Authentication in the async key resolver when it returns an empty string or zero-length buffer. An attacker can gain unauthorized access and assume arbitrary identities by forging JWTs signed with an empty secret, which are then accepted as valid tokens.
Note: This is only exploitable if the application uses an asynchronous callback for key resolution and the callback can return an empty string or zero-length buffer, while HMAC algorithms are allowed (default configuration).
How to fix Improper Authentication? Upgrade fast-jwt to version 6.2.4 or higher.
| |
Incorrect Regular Expressionfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Incorrect Regular Expression in the allowedAud, allowedIss, allowedSub, allowedJti, or allowedNonce options when used with RegExp objects and RegExp is configured with modifiers such as /y and /g. An attacker can cause intermittent authentication failures and potentially trigger retry storms or operational disruptions by repeatedly submitting valid tokens, leading to unpredictable acceptance or rejection outcomes.
How to fix Incorrect Regular Expression? Upgrade fast-jwt to version 6.2.1 or higher.
| |
Not Failing Securely ('Failing Open')fast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Not Failing Securely ('Failing Open') due to improper validation of the crit header parameter. An attacker can bypass intended authorization policies by crafting a signed token with unknown critical header parameters, which are improperly accepted and processed.
How to fix Not Failing Securely ('Failing Open')? Upgrade fast-jwt to version 6.2.0 or higher.
| |
Use of a Broken or Risky Cryptographic Algorithmfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Use of a Broken or Risky Cryptographic Algorithm in the performDetectPublicKeyAlgorithms function due to improper handling of leading whitespace in PEM key strings. An attacker can gain unauthorized access and forge tokens by supplying a public key with leading whitespace, causing the key to be misclassified and allowing arbitrary payloads to be accepted as valid.
Note:
This vulnerability is caused by an incomplete fix for CVE-2023-48223.
How to fix Use of a Broken or Risky Cryptographic Algorithm? Upgrade fast-jwt to version 6.2.0 or higher.
| |
Improper Validation of Unsafe Equivalence in Inputfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Improper Validation of Unsafe Equivalence in Input in the cacheKeyBuilder function when custom implementations do not generate unique keys for different tokens, leading to cache collisions. An attacker can gain unauthorized access to another user's identity and permissions by submitting a token that results in a cache key collision.
Note:
This is only exploitable if caching is enabled and a custom cacheKeyBuilder function is used that can produce identical keys for different tokens.
How to fix Improper Validation of Unsafe Equivalence in Input? Upgrade fast-jwt to version 6.1.0 or higher.
| |
Acceptance of Extraneous Untrusted Data With Trusted Datafast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Acceptance of Extraneous Untrusted Data With Trusted Data when validating an issuer (iss) claim in validateClaimValues(). This function implicitly accepts an array of issuer URLs and accepts it if one member is verified. This behavior is not compliant with RFC 7519, which specifies that a token must be a string. An attacker can bypass the intended verification by sending a JWT whose iss claim includes a malicious domain as well as a legitimate one.
How to fix Acceptance of Extraneous Untrusted Data With Trusted Data? Upgrade fast-jwt to version 5.0.6 or higher.
| |
Improper Input Validationfast-jwt is a Fast JSON Web Token implementation
Affected versions of this package are vulnerable to Improper Input Validation due to improperly prevention of JWT algorithm confusion for all public key types. 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.
Note:
This attack will only work if the victim application utilizes a public key containing the BEGIN RSA PUBLIC KEY header.
How to fix Improper Input Validation? Upgrade fast-jwt to version 3.3.2 or higher.
| |