A medium‑severity vulnerability (CVE‑2026‑119351, CVSS 6.3) was disclosed on 17 Nov 2026 affecting Next.js versions 16.2.0 through 16.4.4. The issue stems from a race condition in the Cache Components system that can cause an outer cache entry to be stored without the root‑parameter metadata produced by a nested cached function, leading to cross‑request data leakage. The flaw is patched in Next.js 16.4.5.
Vulnerability overview
The bug appears when an outer function annotated with the use cache directive invokes an inner use cache function that reads dynamic route data via next/root-params and returns an object containing unresolved promises. Because React Flight streams the resolved part of the object immediately, the outer cache can finish collecting its metadata before the inner stream publishes its root‑parameter dependencies. The resulting outer cache key omits those dependencies, so the first generated entry is reused for subsequent requests that supply different locale, tenant or route‑segment values.
CWE‑362 (Improper Synchronization) classifies the flaw as a race condition. The CVSS v4.0 vector notes network‑accessible unauthenticated HTTP requests as the attack vector, with a medium‑impact rating due to potential cross‑context information disclosure.
Technical mechanism
In the vulnerable code path, collectResult calls propagateCacheEntryMetadata after the outer function completes. Prior to the patch, there was no check for pending promises registered by the inner cache store. Consequently, the outer cache entry could be written while innerCacheStore.pendingNestedCacheMetadata still contained unresolved promises, leaving the outer key incomplete.
The fix introduces a pendingNestedCacheMetadata set on the cache store and a draining loop that awaits Promise.allSettled on that set before metadata is propagated. This guarantees that all inner root‑parameter information reaches the outer store, preventing the creation of a root‑parameter‑agnostic cache entry.
Mitigation and upgrade recommendations
Developers should upgrade to Next.js 16.4.5 or later, which contains the synchronization changes described above. The upgrade can be performed with standard package managers (e.g., npm install [email protected]). After updating, any persistent caches—such as Redis, Vercel ISR caches, or CDN layers—must be purged to eliminate previously stored malformed entries.
As an additional safeguard, code that uses nested use cache should avoid returning unawaited promises from inner functions. If a promise must be included, developers can either await it inside the inner function or explicitly read required root parameters in the outer function to force a distinct cache key.
Impact on production deployments
Applications that rely on per‑tenant or per‑locale data isolation—common in multi‑tenant SaaS platforms, internationalized sites, and dynamic route structures—are the most exposed. A request from one tenant could inadvertently receive cached content generated for another, potentially leaking personal or business‑critical information.
The exploit does not require authentication and works on standard GET requests, but it only triggers when the specific nested‑cache pattern is present. Projects that do not use the use cache directive, or that avoid returning pending promises, remain unaffected.
Why the fix matters for the Next.js ecosystem
Next.js has positioned Cache Components as a core performance feature for server‑rendered React applications. By allowing developers to memoize expensive data fetches at the function level, the framework promises both speed and scalability. However, the CVE‑2026‑119351 incident highlights a subtle concurrency pitfall that can undermine those guarantees. When cache entries are generated without full visibility into their dynamic dependencies, the system can serve stale or incorrect data across logical boundaries that are supposed to be isolated. For developers, the patch reinforces the need to treat cache keys as first‑class security artifacts—not just performance optimizations. The added metadata‑await loop introduces a modest runtime cost, but it restores deterministic cache behavior, which is essential for compliance regimes that require strict data separation. Teams running multi‑tenant Next.js services should prioritize the upgrade, audit their use of nested use cache calls, and incorporate cache‑key validation into their testing pipelines to avoid similar regressions in future releases.
Cover: Carl Lender from Sunrise, USA · CC BY 2.0 · Wikimedia Commons. Layout and headline text by Signal Titans.
Source: CVE-2026-119351: CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js · CVE-2026-119351: CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js | CVEReports

Leave a Reply