Oct 9, 2026·6 min read·2 visits
A flaw in fast-jwt prior to v6.3.0 permits non-finite values (such as Infinity) to bypass validation during verifier initialization. This causes token expiration and activation checks to succeed unconditionally, resulting in complete bypass of JWT expiration controls.
NearForm fast-jwt prior to version 6.3.0 is vulnerable to an input validation flaw where configuring verifier properties (such as clockTolerance, clockTimestamp, and cacheTTL) with non-finite values like Infinity or NaN allows attackers to bypass temporal claim validations, including expiration (exp) and activation (nbf) boundaries. This validation bypass can result in unauthorized session persistence and cache poisoning.
The JSON Web Token (JWT) library fast-jwt is optimized for high-performance claim verification in Node.js applications. A critical aspect of JWT verification is checking temporal boundaries, specifically that the token has not expired (exp claim) and is currently active (nbf claim). The vulnerability surfaces when initializing the verifier using the createVerifier function with specific temporal configuration arguments.
Prior to version 6.3.0, fast-jwt failed to enforce strict finiteness constraints on parameters including clockTolerance, clockTimestamp, and cacheTTL. The library verified that these parameters were of type 'number' and not less than zero, but did not assert that they were finite values. Under JavaScript's type specification, Infinity is a primitive value of type 'number', meaning it bypassed the library's initial validation checks.
When a backend application exposes configuration options or parses environment variables that feed into createVerifier without strict sanitization, an attacker or misconfiguration can specify Infinity as the value for clockTolerance. This results in the complete negation of temporal validation rules, causing the verifier to accept expired or inactive tokens unconditionally.
The root cause of this vulnerability lies in the loose validation logic within src/verifier.js and JavaScript's handling of non-finite numbers. The original validation pattern checked whether options were defined, of the 'number' type, and positive. Because typeof Infinity evaluates to 'number' and the comparison Infinity < 0 yields false, the value Infinity successfully passes this validation block.
When verifying a token, fast-jwt calculates the adjusted expiration time by adding the clockTolerance to the token's exp claim, represented as: adjustedExpiration = payload.exp * 1000 + clockTolerance. If clockTolerance is Infinity, the math evaluates as: payload.exp * 1000 + Infinity = Infinity. The temporal verification check subsequently compares the current system epoch time (now) to the adjusted expiration: now <= Infinity. Since any finite current time is less than or equal to Infinity, this validation always evaluates to true, causing expired tokens to be accepted.
This flaw also affects the Not-Before (nbf) activation claim. The adjusted activation boundary is calculated as: adjustedNotBefore = payload.nbf * 1000 - clockTolerance. With clockTolerance set to Infinity, this calculation yields -Infinity. The verifier checks if now >= -Infinity, which always evaluates to true. This enables the successful use of tokens intended for future execution. Additionally, because validation states are stored in an internal Least Recently Used (LRU) cache, these infinite bounds poison cache keys, keeping entries valid indefinitely.
An examination of the vulnerable code in src/verifier.js reveals how loose validation permitted non-finite numbers to pass through checks:
// Vulnerable Code Path
if (clockTolerance && (typeof clockTolerance !== 'number' || clockTolerance < 0)) {
throw new TokenError(TokenError.codes.invalidOption, 'The clockTolerance option must be a positive number.')
}The validation block only executed if clockTolerance was truthy. A value of NaN is falsy, allowing it to bypass the validation block entirely and reach calculation phases, where it caused different analytical errors. For Infinity, the condition typeof clockTolerance !== 'number' evaluated to false, and clockTolerance < 0 also evaluated to false, allowing the configuration to be set.
To correct this, the patch introduced explicit checks for defined options (rather than truthiness checks) and added the Number.isFinite() validation check:
// Patched Code Path in src/verifier.js
if (
clockTolerance !== undefined &&
(typeof clockTolerance !== 'number' || !Number.isFinite(clockTolerance) || clockTolerance < 0)
) {
throw new TokenError(
TokenError.codes.invalidOption,
'The clockTolerance option must be a finite, non-negative number.'
)
}By checking clockTolerance !== undefined, the parser ensures that falsy but invalid values like NaN trigger an exception instead of bypassing validation. Applying !Number.isFinite() explicitly identifies and blocks Infinity, -Infinity, and NaN, restricting input values to valid finite float or integer ranges.
Exploitation of CVE-2026-107721 relies on a system design flaw where dynamic variables can dictate the configuration of the verifier. If an administrator console, an external database configuration, or a parsed query parameter allows setting the clockTolerance configuration to Infinity, the backend verifier becomes compromised.
Once configured, an attacker can construct an expired JWT or a token designated for future use and transmit it to the application API. The verifier processes the token, evaluates the temporal claims against Infinity boundaries, and yields a valid verification status. The application then processes the request, granting authorized access to protected assets.
The resulting validation outcome is indexed within the LRU cache using keys containing the infinite limits. This means subsequent validation requests can be satisfied directly from the poisoned cache state, maintaining authorization bypass conditions even if the underlying validation variables are temporarily updated.
The impact of this vulnerability is an authorization bypass that invalidates key security constraints of JSON Web Tokens. In environments utilizing short-lived session tokens to enforce security boundaries, the inability to expire credentials permits unauthorized, prolonged access to backend resources.
The CVSS v3.1 base score of 5.9 reflects a Medium severity classification, with the vector CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N. The High Attack Complexity metric denotes that the attack vector depends on the target application propagating unsafe or raw administrative inputs into the library's initialization options.
While this bug does not directly result in Remote Code Execution (RCE) or service disruption, the failure of temporal validation mechanisms undermines security controls, allowing unauthorized entities to perform actions with stale privileges or bypass time-based credential activation schedules.
The recommended remediation is upgrading the fast-jwt package to version 6.3.0 or later, which contains the official fix. This can be accomplished by updating the dependency in the application's configuration files and executing the package manager update:
npm install fast-jwt@latestIf upgrading is not immediately possible, implement external validation to sanitize input parameters prior to initializing the verifier. Developers should ensure that any numeric parameter mapped to clockTolerance, clockTimestamp, or cacheTTL is verified with Number.isFinite() and validated to be non-negative:
function validateVerifierOptions(options) {
const keys = ['clockTolerance', 'clockTimestamp', 'cacheTTL'];
for (const key of keys) {
if (options[key] !== undefined) {
if (typeof options[key] !== 'number' || !Number.isFinite(options[key]) || options[key] < 0) {
throw new Error(`Invalid value for ${key}`);
}
}
}
}Static analysis can assist in identifying unsafe usage. Code review processes should scan for initialization configurations where createVerifier receives options derived from unsanitized administrative configurations or dynamic external input.
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
fast-jwt NearForm | < 6.3.0 | 6.3.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-613, CWE-682 |
| Attack Vector | Network |
| CVSS v3.1 | 5.9 (Medium) |
| Exploit Status | Proof of Concept (Regression Tests) |
| CISA KEV Status | Not Listed |
| Remediation Status | Patched in version 6.3.0 |
The product does not invalidate a session (or JSON Web Token) after an appropriate period of inactivity or absolute time has elapsed.
A critical cryptographic vulnerability in fast-jwt versions 6.2.x prior to 6.3.0 allows unauthenticated remote attackers to execute an asymmetric-to-symmetric algorithm confusion attack due to incomplete validation of leading non-whitespace prefixes.
CVE-2026-107720 is a critical signature verification bypass vulnerability in NearForm's fast-jwt Node.js library. Under specific configurations where the token verifier is initialized with a falsy cryptographic key (such as an empty string or null) and a non-empty algorithms allowlist, the library erroneously skips signature validation. This allows unauthenticated remote attackers to submit fabricated, unsigned JSON Web Tokens and bypass the authorization boundary of the application entirely.
Ruby Mechanize prior to version 2.14.1 contains an information disclosure vulnerability. When executing cross-origin HTTP redirects, global headers configured on the Mechanize agent (such as Authorization or Session Cookies) are dynamically re-applied to the subsequent request, bypassing the internal header-stripping logic. An attacker who controls a redirection endpoint can capture sensitive bearer tokens or cookies.
An origin trust boundary failure in the Ruby mechanize library (prior to v2.14.1) allows unauthenticated remote web servers to harvest sensitive global request headers, such as Authorization Bearer tokens and cookies, by utilizing HTML-level meta-refresh redirection tags. Standard HTTP-level redirect boundaries were not applied to document-level redirects, creating a vector for cross-origin credential leakage during automated crawls.
CVE-2026-107718 is a medium-severity Open Redirect vulnerability in the core HTTP server package of the AdonisJS Node.js framework. Prior to versions 8.2.3 and 9.3.0, the framework built route paths by directly interpolating dynamic parameters and wildcard segments without URI encoding. If an application routes attacker-controlled input directly to a dynamic first path segment and uses the generated route URL as a redirect destination, a leading slash can produce a scheme-relative external URL. Modern web browsers process scheme-relative URLs by redirecting the client to the specified external domain, exposing users to credential harvesting, social engineering, and session hijacking. This vulnerability affects all applications running unpatched configurations where input validation is not explicitly implemented before generating paths.
CVE-2026-107725 is a critical security bypass in Hazelcast where missing authorization checks in the MapPermission class permit unprivileged clients to issue queries containing aggregators or projections. This architectural oversight allows attackers to run arbitrary code on the cluster servers under the privileges of the active Hazelcast process.