Next.js 16.4.5: Which of the Seven Advisories Actually Hit Your App?

2026-12-05来源 dev.toEnglish
Next.js 16.4.5: Which of the Seven Advisories Actually Hit Your App?

Nobody enjoys a second Next.js security release a few weeks after the first. The good news about the November 3 batch is that it is much less urgent than October's critical pair, and most apps will only be touched by one or two of the seven advisories. The bad news is that figuring out which ones requires reading your own code.

Vercel's post lists seven issues fixed in 16.4.5 (Active LTS) and 15.5.29 (Maintenance LTS): one rated High and six Medium. If you missed October, we covered the earlier critical bugs in our write-up of the Next.js 16.4.1 RCE fixes. This batch is a different set. We haven't reproduced any of these ourselves; this is a reading of the official post and its advisories.

The one rated High

GHSA-mfr8-8qww-v76h is a cross-tenant cache disclosure. It affects applications with Cache Components enabled when the same public use cache function is called both directly and from inside unstable_cache, and that function reads a root parameter such as a tenant identifier. During a cold cache fill, a concurrent call through unstable_cache can receive another request's result without the root-parameter check. That result can then be stored and served to later callers until it is revalidated or evicted. Where root parameters separate tenants, the leaked content can be another tenant's data.

If you run a multi-tenant app on Next.js 16 with Cache Components, this is the one to read twice. A related Medium advisory, GHSA-vc7v-qv4w-wrv8, covers nested use cache functions: an inner function reads a root parameter and returns an early value alongside a slower one, the outer function finishes without waiting, and the outer entry is stored without recording the root-parameter dependency. That can serve content generated for one tenant, site or locale to requests for another, though the post notes the attacker does not inject content; the application generated it.

The other five, in plain terms

Binary arguments (GHSA-rhh4-g77r-r9qj, Medium). Distinct binary arguments passed to a use cache function can produce the same cache identity. If you use Uint8Array or Blob arguments to tell users or accounts apart, one caller can receive another's cached result. It does not permit access to unrelated cache entries.

Shell poisoning (Medium). Self-hosted apps running next start with Cache Components on and Partial Prefetching off or unset can have a shared page shell poisoned by an unauthenticated request, producing wrong server-rendered content or persistent 404 responses. It needs a specific route shape: a prerenderable dynamic parameter requested with a value not generated at build time, at least two deeper parameters that are never prerendered, and a blocking fallback shell.

Response framing (GHSA-pc58-hwjq-p385, Medium). Self-hosted apps that return an attacker-controlled fetched Response unchanged can forward decompressed body bytes with the original compressed response's framing headers. Behind an HTTP/1.1 reverse proxy that queues pipelined requests on a shared backend connection, responses can be assigned to the wrong clients. Vercel says it does not apply to every reverse-proxy configuration.

Edge cookies (GHSA-f3mh-rxg3-f5g2, Medium). App Router Edge Route Handlers and Pages Router Edge API routes that set cookies with NextResponse.cookies.set() can expose the serialized cookie in the internal x-middleware-set-cookie header. Unlike Set-Cookie, that header can be read by same-origin JavaScript, so values are exposed even if marked HttpOnly. It needs a sensitive cookie on an affected response plus attacker-controlled JavaScript on the same origin. Node.js route handlers and routes setting cookies through cookies().set() were not affected in the reproduced leak.

SVG bypass (GHSA-7qx7-33qx-rqx2, Medium). An attacker-controlled image from a permitted source can be misclassified as AVIF and bypass images.dangerouslyAllowSVG: false, reaching an SVG parser you configured Next.js to exclude. The remote image allowlist still applies, and Vercel says the finding itself does not demonstrate cross-site scripting or remote code execution.

Find out which ones apply: a grep-first routine

Run these from your project root. They only search; nothing changes.

  1. npm ls next tells you the installed version. Below 16.4.5 on 16.x, or below 15.5.29 on 15.x, you are on an unpatched release.
  2. grep -rn "use cache" app lib components lists every cached function. If this returns nothing and you do not use Cache Components, four of the seven advisories do not touch you.
  3. grep -rn "unstable_cache" app lib shows whether anything wraps a cached function, which is the High advisory's condition.
  4. grep -rn "runtime.*edge" app finds Edge routes. Open each and check for NextResponse cookie calls.
  5. grep -n "cacheComponents|partialPrefetching|dangerouslyAllowSVG" next.config.* shows the settings the advisories refer to.

The table below turns the grep results into a decision. It is our own summary of the official post.

Pattern in your app Advisories to read Applies to
use cache with unstable_cache and a root parameter GHSA-mfr8-8qww-v76h Next.js 16 with Cache Components
Nested use cache functions reading root params GHSA-vc7v-qv4w-wrv8 Next.js 16 with Cache Components
Binary arguments to use cache GHSA-rhh4-g77r-r9qj Next.js 16
next start with blocking fallback shells Shell poisoning advisory Self-hosted, Partial Prefetching off
Returning fetched responses unchanged behind a proxy GHSA-pc58-hwjq-p385 Self-hosted
NextResponse cookies on Edge routes GHSA-f3mh-rxg3-f5g2 Edge runtime routes
Image optimizer on a self-hosted server GHSA-7qx7-33qx-rqx2 Self-hosted

In short, a typical static marketing site on Vercel may match none of these rows, while a multi-tenant dashboard on self-hosted Next.js 16 could match four.

Upgrade first, then audit your own design

The fix is the upgrade: npm install next@16.4.5 for 16.x, or npm install next@15.5.29 for 15.5, then rebuild and redeploy. The official post gives those commands and names those releases as the patched ones.

Don't stop there if you hit a row in the table. A patch removes the bug, not a design that depends on cache keys or on HttpOnly cookies being unreadable. If a sensitive cookie was set on an Edge route before you upgraded, ask whether script on your own origin could have read it. If you passed binary values to use cache to separate users, consider whether you want something less fragile as the cache key, such as a plain string user ID.

Next.js full route cache diagram showing build time and request time flows

Expand

Next.js full route cache diagram showing build time and request time flows

What is still unclear

The official post says nothing about exploitation, and I did not find a report of any in the sources I read. Version ranges also vary by page: one independent write-up noted advisory pages that list affected ranges ending at 16.4.2 while the fixes ship in 16.4.5, and one page whose "fixed in" note did not match the release notes. That write-up's advice is the one I'd follow: upgrade to 16.4.5 and do not rely on a range to decide you are safe on 16.4.3 or 16.4.4.

If you cannot upgrade today, that same write-up lists two workarounds from the advisories: avoid nesting use cache inside unstable_cache, and set partialPrefetching to true in next.config for the fallback-shell issue. Treat those as stopgaps for a day or two, not as a reason to skip the upgrade.

Next.js time-based revalidation diagram with stale and revalidate steps

Expand

Next.js time-based revalidation diagram with stale and revalidate steps

A last practical note for teams: put the check commands into a ticket and assign the self-hosted items to whoever owns the reverse proxy, since two of the advisories depend on proxy behavior and image handling more than on app code.

Originally published on Mango Developer.

原文:https://www.a8q9.cn/en/article/next-js-16-4-5-which-of-the-seven-advisories-actually-hit-your-app-b8cf45.html

相关文章