Oct 8, 2026·7 min read·16 visits
A validation flaw in fast-jwt's cache logic allows expired tokens without an iat claim to bypass verification and remain valid for up to 10 minutes.
An authentication bypass vulnerability in NearForm's fast-jwt before version 6.3.4 allows attackers to replay expired tokens due to an error in the verifier's cache expiration logic. When caching is enabled, the cache TTL defaults to 10 minutes instead of honoring the token's exp claim if the token lacks an iat claim.
NearForm fast-jwt is a high-performance JSON Web Token (JWT) library written for Node.js. It implements an in-memory Least Recently Used (LRU) cache to store verified payloads. This caching layer allows the application to bypass cryptographic operations on subsequent requests presenting the same token, significantly reducing CPU overhead.
The vulnerability designated as CVE-2026-107719 exists within this verification caching logic in src/verifier.js. When verification caching is enabled, the library fails to limit the cache entry lifetime to the token's expiration (exp) timestamp if the token payload does not contain an "issued at" (iat) claim. Consequently, the cache retains the token's validity beyond its absolute expiration date, exposing an authentication bypass risk via session replay.
The flaw falls under the CWE-613 classification (Insufficient Session Expiration). Because the verification check relies on a stateful cache lookup prior to checking the cryptographic signature or parsing the actual token payload, an attacker can reuse a previously authenticated token after it has expired. This vulnerability does not allow token forgery, but it significantly extends the window of opportunity for an attacker utilizing intercepted or leaked tokens.
The root cause of CVE-2026-107719 lies in the logical coupling of the exp (Expiration) claim check with the optional iat (Issued At) claim inside the cacheSet helper function in src/verifier.js. According to the JSON Web Token (JWT) specification (RFC 7519), the iat claim is entirely optional. However, many production systems and identity providers construct tokens using only the mandatory payload properties and the exp claim, omitting iat to minimize token size or simplify generation.
When fast-jwt caches a verified token, it attempts to set the cache entry's maximum lifetime based on the token's claims. In vulnerable versions, the calculation of the upper expiration bound is wrapped entirely in a conditional statement that requires the iat claim to be present. If a token without an iat claim is verified, the evaluation of hasIat returns false, causing the system to skip the block that calculates the token's exact absolute expiration time.
Because the code bypasses the evaluation of the exp claim when iat is absent, the cache entry’s maximum timestamp defaults to 0. A downstream fallback mechanism then intercepts this uninitialized value and overwrites it with the default maximum Cache Time-To-Live (TTL), which defaults to 10 minutes. This behavior ensures that the token remains cached as valid, even if the token’s intrinsic lifetime was explicitly configured to expire in a much shorter interval.
To understand the vulnerability, let us analyze the code path in src/verifier.js before the patch was applied. The cacheSet function is responsible for determining the lower bound (minTime) and upper bound (maxTime) of a token's cached lifetime.
// Vulnerable implementation in src/verifier.js
const hasIat = payload && typeof payload.iat === 'number'
// Add time range of the token
if (hasIat) {
cacheValue[1] = !ignoreNotBefore && typeof payload.nbf === 'number' ? payload.nbf * 1000 - clockTolerance : 0
if (!ignoreExpiration) {
if (typeof payload.exp === 'number') {
cacheValue[2] = payload.exp * 1000 + clockTolerance
} else if (maxAge) {
cacheValue[2] = payload.iat * 1000 + maxAge + clockTolerance
}
}
}In the code above, if payload.iat is absent, the entire conditional block is skipped. The array element cacheValue[2], which represents the absolute expiration time of the cached entry, remains 0. The function later checks if cacheValue[2] === 0 and, if so, re-assigns it to the default maxTTL limit, exposing the security gap.
The patch introduced in commit fc1ddbbe5ce38066ba2cea0b0ce0233932757167 completely decouples the evaluation of the nbf and exp claims from the presence of the iat claim. The refactored code calculates these bounds independently.
// Patched implementation in src/verifier.js
cacheValue[1] = !ignoreNotBefore && typeof payload.nbf === 'number' ? payload.nbf * 1000 - clockTolerance : 0
let expiresAt = clockTimestamp + clockTolerance + cacheTTL
if (!ignoreExpiration && typeof payload.exp === 'number') {
// Select the earlier of the cache TTL limit and token expiration limit
expiresAt = Math.min(expiresAt, payload.exp * 1000 + clockTolerance)
}
// As in its validator, maxAge counts from iat and ignores clockTolerance
if (typeof maxAge === 'number' && typeof payload.iat === 'number') {
expiresAt = Math.min(expiresAt, payload.iat * 1000 + maxAge)
}
cacheValue[2] = expiresAtIn the patched code, expiresAt is first initialized to the safest maximum default. If the token contains an exp claim, the code uses Math.min to force the cache expiration to honor the earlier of the cache's standard TTL or the token's cryptographic expiration time. This effectively eliminates the coupling bug and guarantees that short-lived tokens expire from the cache when they are supposed to.
Exploitation of CVE-2026-107719 requires specific prerequisites. An attacker must first obtain a valid, signed JSON Web Token issued by the target application. This token must lack the iat claim and must be actively verified by the server once to populate the LRU cache. Additionally, the exploit attempt must occur after the token's formal expiration time but before the application's configured cache TTL has elapsed.
An attacker with network access to the API endpoints can intercept their own low-privilege token or steal a token via browser-based vectors. Once the token expires, the attacker replays the expired JWT in successive HTTP requests. Because the server uses fast-jwt with caching enabled, the verifier intercepts the request, locates the token in the cache, and matches the query against the cached entry.
Due to the logical error in the unpatched cacheSet function, the cached entry remains valid. The application bypasses signature and formal temporal validation, treating the request as authenticated. This extends the active session window of the expired token up to the default cache TTL, which is typically 10 minutes, allowing unauthorized action execution.
The impact of this vulnerability is assessed with a CVSS 3.1 base score of 4.2 (Medium severity). While the vulnerability allows authentication bypass, the threat vector is constrained because the attacker cannot forge arbitrary tokens. The attacker is limited to replaying authentic, previously signed tokens that have been validated by the host application at least once during the current cache cycle.
Furthermore, the exploitation window is restricted to the difference between the token's intended lifetime and the configured cache TTL. If an application utilizes short-lived tokens (such as 30-second single-use tokens) to secure sensitive endpoints, this vulnerability increases the risk window tenfold. Within this window, the attacker maintains authorized privileges, potentially accessing confidential data or performing state-modifying actions.
This issue is particularly critical in microservices architectures where token validation occurs frequently at API gateways. Since gateways rely heavily on caching to maintain low latencies, a high percentage of incoming requests are subject to cache validation. This architecture amplifies the vulnerability’s impact, making immediate patching of the verifier layer a priority.
The primary remediation strategy is upgrading fast-jwt to version 6.3.4 or higher, which completely resolves the cache expiration calculation bug. For environments where package upgrades require prolonged QA testing, immediate tactical workarounds can be applied to eliminate the vulnerability.
The most effective workaround is disabling the verifier cache by passing cache: false or omitting the cache configuration option within the createVerifier function call. This forces the library to perform complete signature and claim validation for every request, removing the vulnerable cache lookup path entirely.
Alternatively, if caching must be preserved to maintain API performance, developers can configure the token signers to explicitly include the iat claim in all outbound tokens. Ensure that the noTimestamp configuration option is set to false when using fast-jwt's createSigner. Security teams should also verify that upstream identity providers are configured to append the iat claim to all minted tokens.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
fast-jwt NearForm | < 6.3.4 | 6.3.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-613: Insufficient Session Expiration |
| Attack Vector | Network (Remote) |
| CVSS Score | 4.2 (Medium) |
| Exploit Status | poc |
| KEV Status | Not Listed |
| Affected Component | src/verifier.js (cacheSet function) |
The application does not invalidate a session or token after a pre-determined period of inactivity or absolute expiration, allowing an attacker to reuse expired session credentials.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.