Nov 16, 2026·9 min read·1 visit
Next.js versions >= 16.3.0 and < 16.4.5 contain a race condition (CWE-362) in cross-request cache deduplication. If a function marked with `'use cache'` reads root parameters (`next/root-params`) and is called both directly and via `unstable_cache()` during an initial cold fill, the `unstable_cache()` call joins the in-flight leader request and caches the result without root parameter isolation. This exposes tenant-specific or locale-specific data to subsequent requests until cache eviction or revalidation. Upgrade to Next.js 16.4.5 or remove nested `'use cache'` calls inside `unstable_cache()`.
A race condition in Next.js versions 16.3.0 through 16.4.4 allows cross-request cache poisoning and unauthorized information disclosure across root parameters. When an application invokes the same `'use cache'` function both directly during rendering and wrapped inside `unstable_cache()`, a concurrent `unstable_cache()` request arriving during a cold start cache fill joins the in-flight execution. Because the `unstable_cache()` execution context lacks root parameter tracking, the parameter mismatch verification fails, causing `unstable_cache()` to persist root-parameter-scoped data under a global cache key.
Next.js is a full-stack React framework that implements multiple server-side caching mechanisms to optimize rendering performance and data fetching. Two primary primitives exist within the App Router architecture: the 'use cache' directive, which caches React Server Components (RSC) and server functions, and the legacy unstable_cache() API, which caches asynchronous operations across incoming HTTP requests. Alongside these caching layers, Next.js provides the next/root-params module to allow server functions to read top-level dynamic route segments, such as [tenant], [countryCode], or [lang].
CVE-2026-119790 (tracked internally as NSEC-726 and via advisory GHSA-mfr8-8qww-v76h) is a race condition (CWE-362) affecting Next.js versions 16.3.0 prior to 16.4.5. The vulnerability occurs in the cross-request deduplication logic located in packages/next/src/server/use-cache/use-cache-wrapper.ts. Under normal operation, nesting a 'use cache' function inside unstable_cache() when the inner function accesses root parameters is an unsupported pattern that raises a runtime error.
However, during the very first execution of a 'use cache' function after a cold server start, a synchronization flaw allows a concurrent unstable_cache() invocation to bypass this restriction. By joining an already in-flight direct execution before the runtime knows which root parameters the function reads, the unstable_cache() wrapper receives the leader request's resolved payload.
Once the unstable_cache() call receives this payload, it writes the data into the persistent cache store using a cache key that omits all root parameter values. Consequently, any subsequent request hitting the unstable_cache() code path—regardless of its own root parameter context—receives the cached data generated during the initial cold start request, resulting in cross-tenant or cross-locale data disclosure.
To prevent redundant computation when multiple requests hit the same uncached route simultaneously, Next.js implements cross-request cache deduplication in memory. When a 'use cache' function is invoked for the first time following a process start (a "cold fill"), the Next.js runtime does not yet know which dynamic root parameters (next/root-params) the function body will read during its execution. The runtime tracks discovered root parameters per function identifier in an internal map named knownRootParamsByFunctionId.
Because knownRootParamsByFunctionId.get(id) is initially empty during the cold start, the leader request registers its in-flight execution promise under a coarse deduplication key that excludes root parameter values. As the leader function executes and calls root parameter getters (for example, await lang()), the runtime populates knownRootParamsByFunctionId with the accessed parameter names.
If a second concurrent request (the "joiner") invokes the same 'use cache' function while the leader is still in-flight, it matches the coarse deduplication key and awaits the leader's completion. When the leader finishes, the runtime retrieves updatedRootParamNames = knownRootParamsByFunctionId.get(id) and verifies whether the joiner's rootParams match the leader's rootParams. If two standard direct requests have different root parameters (such as /en and /fr), the mismatch check detects the discrepancy, rejects the shared result for the joiner, and triggers a retry.
The root cause of CVE-2026-119790 lies in how the runtime handles a joiner executing inside unstable_cache(). The unstable_cache() API operates in an isolated execution context where rootParams is undefined. In affected versions of Next.js, the post-fill verification logic did not check whether the joiner's rootParams object was missing entirely when updatedRootParamNames was non-empty. Because rootParams was undefined, the parameter mismatch check failed to separate the joiner from the leader, allowing the unstable_cache() caller to inherit the leader's root-param-specific result and store it under an unparameterized unstable_cache key.
The vulnerability was resolved in commit d605874e5a4b8b6b7dca1b6e07bcabb44d0e2e5b within packages/next/src/server/use-cache/use-cache-wrapper.ts. The patch introduces a helper function, createRootParamsUnavailableError, and inserts explicit validation checks after an in-flight cache fill completes.
First, the patch defines the error constructor used when root parameters are accessed within an unstable_cache context:
function createRootParamsUnavailableError(
route: string,
rootParamNames: ReadonlySet<string>
): Error {
const paramNames = [...rootParamNames].sort().join(', ')
return new Error(
`Route ${route} used root params (${paramNames}) inside \`"use cache"\` nested within \`unstable_cache\`. Root params are not available in this context.`
)
}Next, inside the cache() function in packages/next/src/server/use-cache/use-cache-wrapper.ts, the patch modifies both the prerender-dynamic rendering branch and the standard runtime execution branch. Immediately after retrieving updatedRootParamNames from knownRootParamsByFunctionId.get(id) upon completion of the leader's in-flight promise, the patched code verifies the presence of rootParams in the joiner's context:
const updatedRootParamNames = knownRootParamsByFunctionId.get(id)
// Added in d605874e5a4b8b6b7dca1b6e07bcabb44d0e2e5b:
// Throw when the fill read root params and the joiner has none. A
// joiner without root params is nested in `unstable_cache`. The
// mismatch retry below requires the joiner's root params, so it
// cannot separate this joiner from a leader with different values.
// A fork would serve the leader's root-param-specific entry, and
// `unstable_cache` would persist it under a key that has no root
// params.
if (
updatedRootParamNames &&
updatedRootParamNames.size > 0 &&
!rootParams
) {
cacheSignal?.endRead()
throw createRootParamsUnavailableError(
workStore.route,
updatedRootParamNames
)
}By checking updatedRootParamNames && updatedRootParamNames.size > 0 && !rootParams, the runtime detects that the leader execution consumed at least one root parameter while the joining context lacks root parameter tracking (!rootParams). In the prerender-dynamic branch, cacheSignal?.endRead() is invoked first to properly clean up the prerender tracking signal before throwing the exception.
This fix is complete for this code path. By throwing an unhandled error before the unstable_cache() wrapper receives a return value from the inner 'use cache' function, the promise inside unstable_cache() rejects. Consequently, unstable_cache() aborts its cache write operation and does not persist any data, aligning the cold-join behavior with the warm-cache behavior where direct execution inside unstable_cache() fails immediately upon calling a root parameter getter.
Exploiting CVE-2026-119790 requires a specific application architecture and precise request timing. First, the target Next.js application must define a 'use cache' function that reads at least one root parameter via next/root-params. Second, the application must invoke this same function directly in one code path and wrapped inside unstable_cache() in another code path. Third, the attacker or concurrent traffic must trigger both code paths simultaneously during a cold process start (before knownRootParamsByFunctionId is populated for that function).
The official patch commit (d605874e5a4b8b6b7dca1b6e07bcabb44d0e2e5b) includes a complete end-to-end reproduction test suite under test/e2e/app-dir/app-root-params-getters/fixtures/use-cache-dedup/. The fixture defines a shared cached function in cold-join/shared.ts that reads the lang root parameter after a simulated 2000ms asynchronous delay:
import { lang } from 'next/root-params'
import { setTimeout } from 'timers/promises'
export async function getTenantData() {
'use cache'
await setTimeout(2000)
return {
lang: await lang(),
fillId: Math.random().toString(36).slice(2),
}
}Two separate routes call getTenantData(). The leader route (cold-join/direct/page.tsx) calls await getTenantData() directly. The joiner route (cold-join/mixed/page.tsx) calls await unstable_cache(getTenantData)():
// cold-join/mixed/page.tsx
import { unstable_cache } from 'next/cache'
import { connection } from 'next/server'
import { getTenantData } from '../shared'
export default async function Page() {
await connection()
const data = await unstable_cache(getTenantData)()
return <p id="value">{JSON.stringify(data)}</p>
}To trigger the race condition, an initial request is sent to /ca/en/cold-join/direct, initiating the 2000ms cold fill where lang() resolves to 'en'. While this request is in flight (500ms later), a second request is sent to /ca/fr/cold-join/mixed. On vulnerable versions (16.3.0 to 16.4.4), the /ca/fr/cold-join/mixed request joins the in-flight 'en' execution, receives { lang: 'en', fillId: '...' }, and writes it to the unstable_cache store. Subsequent requests to /ca/fr/cold-join/mixed or any other locale path using that route continue to receive the cached 'en' payload.
The primary impact of CVE-2026-119790 is unauthorized information disclosure across root parameter boundaries. In multi-tenant Next.js applications that route tenants via root segment parameters (such as /[tenant]/dashboard) or localized applications using /[countryCode]/[lang], data generated for the initial tenant or locale during a cold start is leaked to all subsequent callers hitting the unstable_cache() endpoint.
Because unstable_cache() persists its entries in the Next.js Data Cache (which can be backed by the local filesystem or a shared distributed cache in production deployments), the poisoned entry remains active across requests until its Time-To-Live (TTL) expires or an explicit cache revalidation (revalidateTag or revalidatePath) evicts it. This converts a narrow cold-start race condition into a persistent state of cross-parameter data leakage.
GitHub assessed the severity of this vulnerability using CVSS v4.0 with a base score of 6.3 (Medium) and vector CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N. The Attack Vector is Network (AV:N) with No Privileges Required (PR:N) and No User Interaction (UI:N), as standard HTTP requests trigger the cache fills. Attack Requirements are marked as Present (AT:P) because exploitation depends on winning the race window during a cold process start and requires the target application to implement the dual direct/unstable_cache() invocation pattern.
Confidentiality impact on the vulnerable system is rated Low (VC:L) because the attacker cannot arbitrarily read memory or select arbitrary files; the disclosure is restricted to the specific return value of the shared 'use cache' function populated by the concurrent leader request. Integrity (VI:N) and Availability (VA:N) are unaffected.
The primary remediation is to upgrade Next.js to version 16.4.5 or later, which includes commit d605874e5a4b8b6b7dca1b6e07bcabb44d0e2e5b. Administrators and developers can apply the update using their standard package manager:
npm install next@16.4.5
# or
pnpm add next@16.4.5
# or
yarn add next@16.4.5If an immediate framework upgrade is not feasible, developers can eliminate the vulnerability at the application layer by refactoring their caching calls. Specifically, applications must not wrap functions marked with the 'use cache' directive inside unstable_cache(). Both APIs serve overlapping caching purposes, and 'use cache' is designed to replace unstable_cache() in modern Next.js App Router applications.
> [!NOTE]
> After upgrading to Next.js 16.4.5, any routes that previously relied on nesting 'use cache' functions that read root parameters inside unstable_cache() will consistently throw a runtime error during both cold and warm executions.
Engineering teams should audit their codebase for calls to unstable_cache() and verify that the passed callback functions do not invoke 'use cache' functions, particularly those importing getters from next/root-params. Following the upgrade to 16.4.5, security and operations teams can monitor application error logs for the following exception signature to identify any residual incompatible code paths:
Error: Route <route> used root params (<params>) inside `"use cache"` nested within `unstable_cache`. Root params are not available in this context.CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Next.js Vercel | >= 16.3.0, < 16.4.5 | 16.4.5 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-119790 (GHSA-mfr8-8qww-v76h) |
| Weakness Class | CWE-362: Race Condition |
| CVSS v4.0 Score | 6.3 Medium (AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N) |
| Affected Versions | Next.js >= 16.3.0, < 16.4.5 |
| Patched Version | Next.js 16.4.5 |
| Affected Component | packages/next/src/server/use-cache/use-cache-wrapper.ts |
| Primary Impact | Cross-request cache poisoning and disclosure of root-param-scoped data |
| CISA KEV Status | Not Listed |
The product contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
CVE-2026-128074 is an algorithmic complexity and Regular Expression Denial of Service (ReDoS) vulnerability in Nuxt versions 4.6.0 through 4.6.3. The flaw resides in the server-side rendering (SSR) runtime components responsible for payload URL generation and experimental early 404 route evaluation. By sending unauthenticated HTTP requests containing long sequences of repeated forward slashes followed by a non-slash character, an attacker can force the V8 regular expression engine into quadratic O(N^2) backtracking, blocking the single-threaded Node.js event loop and degrading application availability.
CVE-2026-128075 (GHSA-96x6-fvhx-49hg) is an information disclosure vulnerability in the Nuxt framework affecting versions 3.0.0 prior to 4.6.4. During Server-Side Rendering (SSR), unhandled non-HTTP exceptions thrown within pages, plugins, or route middleware are automatically wrapped using createError without being flagged as unhandled. Consequently, the production SSR serializer treats these internal exceptions as deliberate public HTTP errors and embeds their raw message and data properties—which frequently contain internal URLs, API credentials, and upstream response payloads—directly into the client-accessible __NUXT_DATA__ hydration state and JSON error responses.
CVE-2026-128076 is an improper encoding and delimiter injection vulnerability in the Nuxt framework affecting Server Components (NuxtIsland). The flaw serves as an incomplete fix for CVE-2026-46342, where the underlying object hashing routine fails to escape structural delimiters in property keys and string values. This enables attackers to craft distinct sets of component properties that resolve to an identical `/__nuxt_island/<Name>_<hash>.json` route path. In deployments relying on static prerendering or path-only CDN caching, this hash collision permits cache poisoning, content substitution, and Cross-Site Scripting (XSS) if island props flow into unescaped HTML sinks.
CVE-2026-128072 (GHSA-x2wv-5868-p7v2) is an origin validation vulnerability (CWE-346) in the Nuxt framework affecting the development middleware of @nuxt/webpack-builder and @nuxt/rspack-builder. Prior to version 4.6.4, the internal same-origin verification logic evaluated Sec-Fetch-Site, Origin, and Referer headers without first validating that the HTTP Host header belonged to an authorized hostname allowlist. This flaw allows a remote attacker to execute a DNS rebinding attack against a developer's local workstation, bypassing same-origin protections to read compiled client-side JavaScript chunks, inline source maps, local filesystem paths, and embedded client configuration values.
CVE-2026-128087 (GHSA-9264-jvgf-6w2f) is an incorrect behavior order (CWE-696) and improper authorization (CWE-863) vulnerability in the russh Rust SSH library, affecting versions 0.55.0 through 0.65.0. During the initial SSH key exchange (KEX) handshake, the client state machine invokes the client::Handler::kex_done() callback—providing the negotiated raw shared secret bytes—prior to validating the remote server's host key or certificate via check_server_key(). Consequently, an untrusted or rogue SSH server can complete cryptographic key agreement and force a connecting client to execute side-effecting application logic inside kex_done() before the server's identity is checked and rejected.
CVE-2026-128082 (GHSA-6vhm-j9h7-f9gh) is an uncontrolled recursion vulnerability (CWE-674) in AutoMapper, a convention-based object-object mapper for .NET. When mapping nested or self-referential types into destination models that rely on parameterized constructors, C# positional records, or recursive ConstructUsing expressions, AutoMapper evaluates child constructor arguments prior to incrementing the parent's recursion depth counter. This ordering flaw bypasses both explicit MaxDepth limits and the default depth limit of 64. An unauthenticated remote attacker can supply deeply nested input payloads to affected endpoints, exhausting the thread call stack and triggering an uncatchable System.StackOverflowException that terminates the hosting .NET process.