Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

CVE-2026-119790: CVE-2026-119790: Cross-Request Cache Poisoning and Information Disclosure via Race Condition in Next.js

CVE-2026-119790: Cross-Request Cache Poisoning and Information Disclosure via Race Condition in Next.js Vulnerability ID: CVE-2026-119790 CVSS Score: 6.3 Published: 2026-11-16 A race condition in Next.js versions 16

CVE-2026-119790: Cross-Request Cache Poisoning and Information Disclosure via Race Condition in Next.js

Vulnerability ID: CVE-2026-119790
CVSS Score: 6.3
Published: 2026-11-16

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.

TL;DR

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().

⚠️ Exploit Status: POC

Technical Details

  • 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

Affected Systems

  • Next.js (vercel/next.js)
  • Next.js: >= 16.3.0, < 16.4.5 (Fixed in: 16.4.5)

Code Analysis

Commit: d605874

[lts-active] Fix 'unstable_cache' leaking cold ''use cache'' fills across root params (#277)

--- a/packages/next/src/server/use-cache/use-cache-wrapper.ts
+++ b/packages/next/src/server/use-cache/use-cache-wrapper.ts
@@ -731,6 +731,16 @@ function isMatchingRootParams(
   return true
 }

+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.`
+  )
+}
+
 export async function cache(
   kind: string,
   id: string,
@@ -932,6 +942,17 @@ export async function cache(
           if ( joinedAfterFirstCheck ) {
             const updatedRootParamNames = knownRootParamsByFunctionId.get(id)
+            if (
+              updatedRootParamNames &&
+              updatedRootParamNames.size > 0 &&
+              !rootParams
+            ) {
+              cacheSignal?.endRead()
+              throw createRootParamsUnavailableError(
+                workStore.route,
+                updatedRootParamNames
+              )
+            }

Exploit Details

  • GitHub (Official E2E Regression Test Suite): End-to-end test fixture in test/e2e/app-dir/app-root-params-getters/fixtures/use-cache-dedup/ demonstrating the concurrent cold-join race condition between direct rendering and unstable_cache().

Mitigation Strategies

  • Upgrade Next.js to version 16.4.5 or higher to enforce strict root parameter isolation checks during cold cache fills.
  • Refactor application code to remove nesting of 'use cache' functions inside unstable_cache() wrappers.
  • Ensure functions utilizing next/root-params getters are only cached using the native 'use cache' directive directly within App Router rendering flows.

Remediation Steps:

  1. Update package.json to reference [email protected] or later and redeploy the application.
  2. Purge or invalidate existing persistent Data Cache entries if the application was previously running a vulnerable version with mixed 'use cache' and unstable_cache() patterns.
  3. Search application source code for unstable_cache usages and verify that wrapped functions do not call 'use cache' functions that access next/root-params.
  4. Monitor server runtime logs for used root params (...) inside "use cache" nested within unstable_cache errors to catch any remaining misconfigurations.

References

Read the full report for CVE-2026-119790 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.