Skip to content
Security & Trust

Next.js caching flaw can serve content meant for one route value to another

A nested 'use cache' bug can store a response under a key that leaves out a root param, so one entry serves every value

W
WebPulse Newsroom
AI-assisted · 4 min read
Share on X LinkedIn
Next.js caching flaw can serve content meant for one route value to another
In brief
  • A GitHub advisory for Next.js says nested 'use cache' functions can store an entry without its root param in the key, so one value's content can serve another.
  • The advisory says an attacker cannot choose which content leaks. The first invocation to write the entry decides it.
  • Teams using Cache Components with root params should read the advisory and the November Next.js release notes, then check which cached pages vary by those params.

A cache is a promise about who sees what

A cache stores an answer so the system does not have to work it out again. That only helps if the system knows which question the answer belongs to. The label on each stored answer is called the cache key. When the key is wrong, speed turns into a disclosure problem.

That is the situation described in a new GitHub advisory for Next.js, the web framework from Vercel. The advisory is GHSA-vc7v-qv4w-wrv8 and links to CVE-2026-119351. It covers a case where content produced for one value can be served to a request for another.

What the advisory says went wrong

The flaw applies when Cache Components is enabled. In that mode, developers mark functions with 'use cache' so Next.js stores their results. One cached function can call another, and the advisory calls these outer and inner functions.

The inner function may read a root param. These are values the route itself supplies, read through next/root-params. The cache is meant to treat each of them as part of the entry's identity.

The trouble starts when the inner function returns something unfinished. The advisory gives the example of an object holding data that is ready now alongside slower data that is still pending.

React Flight, the mechanism React uses to stream results, hands the ready part to the outer function early. At that moment the inner entry has not yet finished recording which root params it depended on.

The outer function then completes. Its entry is saved under a key that omits the root param. Once saved, a single entry answers requests for every root param value.

In plain terms, the label on the box leaves out the one detail that says whose content is inside.

Limits the advisory sets out

The advisory says the leaked values cannot be attacker controlled. Which content is served depends on which invocation wrote the entry first.

That is a narrower claim than it may sound, and it still matters. Whichever invocation writes first decides what later requests are shown.

The advisory describes a second effect. Such entries may also skip tag-based purges and outlive the expiry set on the caches they were built from. A team that clears a tag to remove stale or sensitive content may find this entry did not respond.

The advisory calls this a variant of GHSA-h694-7cp9-m8p3. The fix for that earlier advisory does not cover it. The earlier problem needed the inner call to be answered from an existing entry and involved a slow cache handler. This variant needs neither condition.

The advisory does not state a severity score or the affected version range in the text provided. It links to the Next.js v16.4.5 release and the project's November 2026 security release post. Those are the places to confirm fixed versions.

Why executives should care

Next.js is common among the sites WebPulse can identify. In its September 2026 scan of the Tranco top 10,000 domains, 7,064 responded and a platform was detected on 2,491. Next.js accounted for 791 of those, or 31.8%.

That figure says nothing about how many sites use Cache Components or root params. It shows only how widely the framework runs among detected sites in that sample.

The lesson here is that caching is an access-control decision dressed as a performance feature. A cache key decides who sees which content. Cache keys deserve the same review as permissions and logins.

The wrong content here is simply content that belongs to another value, served as if it were right. Nothing in the advisory suggests this would trigger an error, so teams should not expect the bug to announce itself.

What to ask your team

Start with exposure. Ask whether any application uses Cache Components and reads root params inside a 'use cache' function. Ask whether those functions are nested.

Next, ask which cached pages differ by root param, and what a visitor would see if the wrong version were served. A page that varies by region is a different risk from one that varies by customer.

Then ask for the version in production, and compare it with the fixed releases named in the Next.js security post. Ask whether cached entries from before the upgrade were cleared. The advisory says affected entries can ignore tag invalidation, so a normal purge may not be enough.

The speed a cache buys is worth having. The key that guards it deserves the same scrutiny as any lock.

Produced by the WebPulse Newsroom with AI assistance from the original reporting credited below, and checked against that source by our editorial review. How we use AI.
Original reporting: GitHub Advisory Database.

CVE-2026-119351: Next.js
Next.js vs React