Skip to content
Brief Security & Trust ·

Next.js cache flaw can show one locale's data to another

The GitHub Advisory Database describes a race in Next.js caching that can mix up data between root params.

In brief
  • A Next.js race can return cached data built for one root param to requests for other values. It needs a function used both directly and through unstable_cache().
  • The advisory says avoiding that nesting is a complete workaround. It does not list affected versions.

The GitHub Advisory Database published an advisory on 16 November 2026 about a Next.js caching bug. Some apps scope data by root params, the route values set in the top-level layout, such as a locale. The advisory says cached data made for one value can reach requests for another. This happens when one 'use cache' function reads a root param and runs both in normal rendering and inside unstable_cache().

The advisory blames a race when a process starts cold. An unstable_cache() call attached itself to a direct call's first fill that was still running. It took that result without the root param check, then stored it under a key with no root params. Other values received it until the entry was revalidated or evicted. The advisory does not name affected versions, count exposed apps, or say whether anyone has exploited it. It links to a v16.4.5 release and a November 2026 security post.

The notable point is that this mix is meant to fail with an error, and the race turns that error into a silent leak. A passing test run therefore proves little. A sensible first step is to name an owner for an audit, list which data is scoped by root params, and search the code for functions reachable both ways. The advisory says avoiding the nesting is a complete workaround.

A WebPulse Brief: a short report of an important event, written by the WebPulse Newsroom with AI assistance and checked against the reporting below. When there is more to explain, we follow up with a full story. How we use AI.

Reporting: GitHub Advisory Database.