CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-119351

CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js

Amit Schendel
Amit Schendel
Senior Security Researcher

Nov 17, 2026·10 min read·0 visits

Executive Summary (TL;DR)

Next.js applications using nested 'use cache' directives and 'next/root-params' can experience cross-request cache leakage if the inner cached function returns pending promises. The outer cache finalizes its cache key before the inner stream publishes its root parameter metadata, persisting a root-parameter-agnostic cache entry that serves data from the initial invocation to subsequent requests across different locales, tenants, or route segments.

A race condition and improper synchronization vulnerability (CWE-362) exists in Next.js versions 16.2.0 prior to 16.4.5 when Cache Components ('use cache' directive) are enabled. When an outer cached function calls a nested cached function that reads dynamic root parameters via 'next/root-params' and returns an object containing pending promises, React Flight can resolve and deliver the ready portion of the payload before the inner cache finishes publishing its root parameter dependencies. Consequently, the outer cache entry finalizes and persists under a cache key that omits the root parameter dependencies, causing the first written cache entry to be served across requests with different root parameter values and bypassing nested cache invalidation rules.

Vulnerability Overview

Next.js versions 16.2.0 through 16.4.4 contain a concurrency and synchronization flaw within the Cache Components subsystem ('use cache' directive). In Next.js App Router architectures, functions annotated with 'use cache' dynamically construct cache keys based on function arguments, execution context, and dynamic root parameters retrieved via the next/root-params module (such as top-level route parameters representing tenant identifiers, country codes, or language locales).

When cached functions are nested, the inner cached function must propagate its metadata—specifically the list of root parameters it read, its cache tags, and its revalidation lifetimes—upward to the enclosing outer 'use cache' store. This upward propagation ensures that the outer cache entry's key and expiration lifecycle accurately reflect all dynamic dependencies consumed during nested execution.

Classified under CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization), CVE-2026-119351 occurs when an inner 'use cache' function reads a root parameter and returns a composite structure containing both resolved properties and unfulfilled promises. Because Next.js serializes cached values using the React Flight protocol, the outer function can receive and unwrap the resolved portion of the inner response while the inner React Flight stream remains open waiting for the pending promises to settle.

If the outer function finishes executing before the inner stream concludes, the outer cache wrapper finalizes its cache entry before receiving the inner store's metadata. The outer entry is then persisted under a cache key that omits the dynamic root parameter dependency. Subsequent HTTP requests supplying different root parameter values match this overly broad outer cache key and receive the cached response generated by the initial request, leading to cross-context information disclosure and broken cache invalidation semantics.

Root Cause Analysis

The root cause of CVE-2026-119351 resides in how packages/next/src/server/use-cache/use-cache-wrapper.ts coordinates stream completion and metadata propagation between nested UseCacheStore instances. When a 'use cache' function executes, Next.js serializes its return value into a React Flight stream and collects the resulting chunks in the collectResult function. Only after the inner stream finishes does the inner invocation finalize its CacheEntry metadata and propagate accessed root parameter names (readRootParamNames), cache tags, and expiration parameters (revalidate, expire, stale) into outerWorkUnitStore.

Under the React Flight serialization protocol, an object containing both immediate primitives and pending promises is streamed incrementally. The top-level root model of the object resolves immediately as soon as the initial chunk is deserialized by the caller, while referenced promises remain pending as trailing chunks in the Flight stream (referred to as a Flight tail). When an outer 'use cache' function awaits an inner 'use cache' call and immediately extracts only the resolved property (ignoring or discarding the pending promise), the outer function's execution body completes immediately.

Prior to version 16.4.5, when the outer function completed its execution body, its collectResult routine immediately closed the outer stream and read innerCacheStore.readRootParamNames to build the outer cache key. It possessed no synchronization mechanism to detect that a nested 'use cache' invocation still had an open Flight stream with unpropagated metadata. Because the inner stream was still waiting for its pending promise tail to resolve, propagateCacheEntryMetadata had not yet executed.

> [!NOTE] > CVE-2026-119351 is distinct from an earlier vulnerability, CVE-2026-103004. While CVE-2026-103004 required an already warm inner cache entry or a slow custom cache handler to trigger a metadata race, CVE-2026-119351 triggers on completely cold cache states during fresh generation whenever an inner cached function returns a pending promise in its Flight payload.

Code Analysis

The vulnerability was remediated in commit 80c96ede21798d4ad54da12fe50d5b00a09b06e3 by introducing explicit promise tracking for nested cache metadata across both fresh cache generations and joined in-flight cache reads. First, the CommonUseCacheStore interface in packages/next/src/server/app-render/work-unit-async-storage.external.ts was extended to maintain a Set of pending metadata promises from child cache contexts.

// packages/next/src/server/app-render/work-unit-async-storage.external.ts
export interface CommonUseCacheStore extends CommonCacheStore, RevalidateStore {
  readonly explicitRevalidate: undefined | number
  readonly explicitExpire: undefined | number
  readonly explicitStale: undefined | number
  readonly tags: null | string[]
  readonly hmrRefreshHash: string | undefined
  readonly isHmrRefresh: boolean
  readonly serverComponentsHmrCache: ServerComponentsHmrCache | undefined
  readonly forceRevalidate: boolean
  readonly outerOwnerStack: string | undefined
  /**
   * Entry collection waits for these promises before it reads metadata from
   * this store.
   */
  readonly pendingNestedCacheMetadata: Set<Promise<unknown>>
}

In packages/next/src/server/use-cache/use-cache-wrapper.ts, the patch introduced trackNestedCacheMetadata, which registers a pending metadata promise onto the parent outerWorkUnitStore.pendingNestedCacheMetadata set and automatically removes it via .finally() once settled. Furthermore, createTrackedMetadataPromise was created to generate a deferred promise wrapper when a fresh inner cache invocation begins.

// packages/next/src/server/use-cache/use-cache-wrapper.ts
function trackNestedCacheMetadata(
  cacheContext: CacheContext,
  pendingMetadata: Promise<unknown>
): void {
  const { outerWorkUnitStore } = cacheContext
  if (
    cacheContext.skipPropagation ||
    (outerWorkUnitStore.type !== 'cache' &&
      outerWorkUnitStore.type !== 'private-cache')
  ) {
    return
  }
 
  const pendingSet = outerWorkUnitStore.pendingNestedCacheMetadata
  const tracked = pendingMetadata.finally(() => {
    pendingSet.delete(tracked)
  })
  tracked.catch(ignoreReject)
  pendingSet.add(tracked)
}

Within collectResult, before the outer cache store inspects its accumulated metadata (readRootParamNames, tags, and revalidation timers) and writes the stream to the cache handler, it now executes a draining loop. This while loop awaits Promise.allSettled on innerCacheStore.pendingNestedCacheMetadata until the set is completely empty, ensuring that even multi-level nested cache hierarchies or promises registered mid-wait complete their metadata propagation first.

// packages/next/src/server/use-cache/use-cache-wrapper.ts (inside collectResult)
  // Wait for nested metadata before collecting this entry's metadata. React
  // Flight can resolve a nested root model while its referenced promises remain
  // pending. The outer function can omit those promises from its result. Its
  // stream can then finish before the nested metadata propagates. The loop
  // includes promises registered while it waits.
  while (innerCacheStore.pendingNestedCacheMetadata.size > 0) {
    await Promise.allSettled(innerCacheStore.pendingNestedCacheMetadata)
  }
 
  propagateCacheEntryMetadata(cacheContext, collectedMetadata)

Finally, the fix also addresses concurrent request deduplication in serveJoinedCacheEntry and generateCacheEntry. When a second concurrent invocation joins an already running in-flight cache entry (sharedCacheEntry), the joined invocation creates its own propagation promise tied to sharedCacheEntry.pendingMetadata and registers it via trackNestedCacheMetadata. This guarantees that an outer cache function joining an existing inner stream also blocks key generation until the shared inner entry's metadata has been propagated to the joining outer store.

Exploitation & Proof of Concept

Triggering CVE-2026-119351 does not require authentication, special privileges, or complex network positioning; it occurs during standard HTTP GET requests to affected Next.js routes. However, as reflected by the Attack Requirements (AT:P) metric in the CVSS v4.0 vector, the target application must implement a specific architectural pattern: an outer 'use cache' function calling an inner 'use cache' function that reads from next/root-params and returns an object containing an unawaited promise.

The reproduction scenario derived from the Next.js regression test suite (test/e2e/app-dir/app-root-params-getters/fixtures/use-cache-dedup/app/[countryCode]/[lang]/flight-tail/page.tsx) demonstrates how this pattern leads to cross-parameter cache pollution:

// app/[countryCode]/[lang]/flight-tail/page.tsx
import { lang } from 'next/root-params'
import { connection } from 'next/server'
import { setTimeout } from 'node:timers/promises'
 
async function inner() {
  'use cache'
  const language = await lang()
  return {
    early: language,
    // Pending promise keeps the inner React Flight stream open
    tail: setTimeout(3000),
  }
}
 
async function outer() {
  'use cache'
  // Outer function extracts only the resolved 'early' field
  // and finishes before 'tail' resolves in the inner stream
  return (await inner()).early
}
 
export default async function Page() {
  await connection()
  const value = await outer()
  const { tail } = await inner()
  await tail
  return <p id="value">{value}</p>
}

When the application receives an initial request to GET /ca/en/flight-tail, the page invokes outer(), which in turn invokes inner(). Inside inner(), await lang() reads the root parameter "en" and records 'lang' in the inner cache store's readRootParamNames set. inner() then returns { early: "en", tail: Promise }. React Flight immediately serializes the top-level object and resolves the await inner() call inside outer(), while keeping the inner Flight stream open for 3000ms until tail settles.

Because outer() only returns .early, outer() finishes executing immediately and triggers collectResult(). On vulnerable versions (16.2.0 to 16.4.4), outer() finalizes its cache entry before the 3000ms timer in inner() completes. Consequently, 'lang' has not yet been copied into the outer store's readRootParamNames, and the outer result "en" is cached under a key that does not include the lang parameter. When a second user requests GET /ca/fr/flight-tail (expecting French content "fr"), outer() computes the exact same parameter-less cache key, hits the cache entry populated by the first request, and erroneously serves "en".

Impact Assessment

The primary security impact of CVE-2026-119351 is unauthorized cross-context information disclosure (VC:L in CVSS v4.0), accompanied by a failure of cache lifecycle management. In multi-tenant or localized Next.js applications, dynamic root parameters (next/root-params) are commonly used to partition application state by tenant ID, organization slug, geographic region (countryCode), or language (lang). When the outer cache key omits these root parameters, data generated for one root parameter context is served to users requesting entirely different root parameter contexts.

The confidentiality impact is bounded by two technical constraints. First, an attacker cannot inject arbitrary payloads into the cache; the cached data is legitimately generated by the application for whichever root parameter value happened to populate the cold cache entry first. Second, next/root-params only accesses top-level dynamic route parameters rather than arbitrary user-specific session cookies or authorization headers (as accessing cookies() or headers() is disallowed inside standard 'use cache' scopes unless private caching is used).

In addition to serving mismatched data across root parameters, the vulnerability breaks cache invalidation and expiration accuracy. Because propagateCacheEntryMetadata also propagates cache tags (tags), revalidate, expire, and stale configurations from the inner store to the outer store, premature completion of the outer cache entry causes it to ignore nested cache tags and lifetimes. If an administrator triggers on-demand revalidation via revalidateTag() targeting a tag attached inside the inner 'use cache' function, the outer cached entry will not be invalidated and will continue serving stale data until its own default expiration timer elapses.

Remediation & Mitigation

To remediate CVE-2026-119351, upgrade the next package to version 16.4.5 or later. Version 16.4.5 incorporates commit 80c96ede21798d4ad54da12fe50d5b00a09b06e3, which enforces strict synchronization by awaiting all nested metadata promises in collectResult before finalizing outer cache keys or persisting cache entries.

# Upgrade using npm
npm install next@16.4.5
 
# Upgrade using pnpm
pnpm update next@16.4.5
 
# Upgrade using yarn
yarn upgrade next@16.4.5

For environments where an immediate upgrade to 16.4.5 is not operationally feasible, development teams can apply code-level workarounds to eliminate the desynchronization window:

  1. Await All Promises Before Returning from Inner Cache Functions: Refactor nested 'use cache' functions so that they do not return objects containing pending promises. Ensure all asynchronous operations are fully awaited inside the inner function body prior to returning the serializable structure.
  2. Explicitly Pass Root Parameters as Arguments: Read the root parameter via next/root-params in the outer 'use cache' function (or in the parent Server Component) and pass the resolved string directly as an explicit argument into the outer 'use cache' function. Because function arguments are hashed directly into the outer cache key prior to execution, the outer cache key will vary by root parameter regardless of inner stream timing.
// Workaround: Read root param directly in the outer cached function
async function outer() {
  'use cache'
  // Reading lang() directly in outer() registers the dependency on the outer store immediately
  await lang()
  return (await inner()).early
}

Official Patches

VercelOfficial fix commit synchronizing nested cache metadata promises
VercelNext.js v16.4.5 Release Tag
VercelGitHub Security Advisory GHSA-vc7v-qv4w-wrv8

Fix Analysis (1)

Technical Appendix

CVSS Score
6.3/ 10
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
EPSS Probability
0.24%
Top 85% most exploited

Affected Systems

Vercel Next.js (npm:next)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Next.js
Vercel
>= 16.2.0, < 16.4.516.4.5
AttributeDetail
Vulnerability IDCVE-2026-119351 / GHSA-vc7v-qv4w-wrv8
Weakness ClassCWE-362 (Race Condition / Improper Synchronization)
CVSS v4.0 Score6.3 MEDIUM (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)
EPSS Score0.24% (15.28th Percentile)
Attack VectorNetwork (Unauthenticated HTTP requests)
Primary ImpactCross-context cache leakage and bypassed nested cache tag invalidation
Affected VersionsNext.js >= 16.2.0, < 16.4.5
Patched VersionNext.js 16.4.5

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-362
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

The program 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.

Vulnerability Timeline

Patch committed (80c96ede21798d4ad54da12fe50d5b00a09b06e3) by Vercel engineering.
2026-11-03
Next.js v16.4.5 released along with the November 2026 Security Release blog post.
2026-11-03
GitHub Security Advisory GHSA-vc7v-qv4w-wrv8 published.
2026-11-16
CVE-2026-119351 published in NVD and CVE.org.
2026-11-16

References & Sources

  • [1]GitHub Security Advisory GHSA-vc7v-qv4w-wrv8
  • [2]Official Fix Commit (80c96ede21798d4ad54da12fe50d5b00a09b06e3)
  • [3]Next.js Release Tag v16.4.5
  • [4]Next.js Security Release Announcement (November 2026)
  • [5]CVE Record on CVE.org: CVE-2026-119351
  • [6]National Vulnerability Database (NVD) Entry: CVE-2026-119351
Related Vulnerabilities
CVE-2026-103004

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-68934
8.7

CVE-2026-68934: OS Command Injection in code-review-mcp-server via Unsafe Shell Execution

A remote OS command injection vulnerability (CWE-78) exists in code-review-mcp-server prior to version 1.5.3. The application passes caller-controlled tool parameters directly into Node.js child_process.execSync() calls without proper neutralization. An attacker or compromised LLM agent invoking tools such as getLocalGitDiff, codeReview, createPR, or getPRTemplate can inject arbitrary shell commands that execute with the privileges of the MCP server host process.

Alon Barad
Alon Barad
2 views•11 min read
•about 2 hours ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 3 hours ago•CVE-2026-129296
6.5

CVE-2026-129296: Path Traversal in SpamScope mail-parser Attachment Extraction

SpamScope mail-parser versions 3.8.0 prior to 4.6.0 contain a path traversal vulnerability (CWE-22) within the write_attachments() and write_sample() functions. The library passes untrusted attachment filenames directly into os.path.join() without stripping directory components, validating path containment, or verifying symbolic links. An attacker can send a crafted email containing relative path traversal sequences or absolute filesystem paths in the Content-Disposition header to write or overwrite arbitrary files accessible to the parsing process.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 4 hours ago•CVE-2026-129295
7.5

CVE-2026-129295: Polynomial Regular Expression Denial of Service (ReDoS) in SpamScope mail-parser

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SpamScope mail-parser versions 4.2.0 prior to 4.6.1. Two separate regular expressions evaluated during standard email header parsing exhibit quadratic to cubic backtracking complexity when processing headers padded with whitespace or angle brackets. An unauthenticated remote attacker can exploit this flaw by sending a small, RFC-compliant email message, causing parsing worker threads or processes to stall at 100% CPU utilization for extended periods.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 5 hours ago•CVE-2026-129297
7.5

CVE-2026-129297: Sender IP Address Spoofing in SpamScope mail-parser

CVE-2026-129297 is an origin validation vulnerability (CWE-345) in the Python library mail-parser prior to version 4.6.2. The MailParser.get_server_ipaddress() method fails to properly isolate MTA-recorded client IP addresses from sender-controlled text within email Received headers. Due to naive substring delimiter matching, appearance-based regular expression scanning, and fail-open header traversal, remote attackers can spoof their originating IP address to bypass email security controls, blocklists, and anti-spam attribution.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 6 hours ago•CVE-2026-129299
6.5

CVE-2026-129299: Uncaught Exceptions and Silent Header Loss via Reflective Attribute Dispatch in SpamScope mail-parser

CVE-2026-129299 (GHSA-24mq-4vc6-2prf) is a parsing and serialization flaw in SpamScope mail-parser prior to version 4.6.2. The library uses reflective Python attribute resolution (getattr) over untrusted email header names and applies caller convenience transformations (such as underscore-to-hyphen folding and _json/_raw suffix stripping) directly to wire headers. An unauthenticated remote attacker can send crafted emails that trigger uncaught TypeError exceptions during JSON serialization or cause security-relevant headers and body content to be silently dropped without setting defect indicators.

Amit Schendel
Amit Schendel
3 views•11 min read