Skip to content

Next.js9 min read

Next.js Security Release Nov 2026: What to Patch

The Next.js November 2026 security release fixes 7 advisories in 16.4.5 and 15.5.29. Who is affected, how to check your version and audit risky use cache code.

The Next.js November 2026 security release fixes seven advisories (one high, six medium), and the fix is to upgrade to Next.js 16.4.5 or 15.5.29 or later. Most of the issues sit in Cache Components and 'use cache', where cached output for one tenant, locale or user could be served to another. The rest cover cookies set in Edge routes, SVG files sneaking past image optimization, and compressed responses on self-hosted servers.

The release went out on 3 November 2026, and 16.4.6 followed on 9 November as a bug-fix backport, so you can go straight to the newest 16.4.x. Here is what each advisory means, how to tell if you are exposed, and how I would audit a codebase for the risky patterns.

Key takeaways

  • Upgrade to 16.4.5+ on the 16.x line or 15.5.29+ on the 15.x line. 16.4.6 is the latest stable 16.4.x at the time of writing.
  • The one high severity issue needs Cache Components plus the same public 'use cache' function called both directly and inside unstable_cache. Removing that nesting is a complete workaround.
  • Apps that pass binary arguments (like Uint8Array or Blob) into 'use cache' functions could mix up users' cache entries on 16.0.0 to 16.4.4.
  • Edge Route Handlers and Edge API routes that set cookies with NextResponse.cookies.set() could leak those values, including HttpOnly cookies, through the x-middleware-set-cookie header.
  • Three issues are scoped to self-hosted apps in the advisories. If you run next start or a Docker image, do not treat this release as optional.
  • Check what is really installed with npm ls next, not what package.json says.

What the November 2026 release fixes

Here is the full list from the official Next.js post, with the affected ranges from each GitHub advisory:

Advisory Severity Area Affected
GHSA-mfr8-8qww-v76h High use cache called inside unstable_cache 16.3.0 to 16.4.4
GHSA-vc7v-qv4w-wrv8 Medium Nested use cache and root params 16.2.0 to 16.4.4
GHSA-rhh4-g77r-r9qj Medium Binary arguments to use cache 16.0.0 to 16.4.4
(no GHSA linked) Medium Shared shell poisoning, self-hosted Cache Components apps
GHSA-pc58-hwjq-p385 Medium Compressed response framing, self-hosted 16.0.0 to 16.4.4, up to 15.5.28
GHSA-f3mh-rxg3-f5g2 Medium Edge route cookies 16.0.0 to 16.4.4, 15.0.0 to 15.5.28
GHSA-7qx7-33qx-rqx2 Medium SVG bypass in image optimization 16.0.0 to 16.4.4, 15.0.0 to 15.5.28

On Next.js 16 with Cache Components, most of this list applies. On 15, three advisories apply and the upgrade is a patch bump.

Who is affected

Apps using Cache Components and 'use cache'

Four advisories are about the cache key. A 'use cache' function is keyed on its arguments, its captured variables and, when it reads them, root parameters such as a tenant or locale segment. I covered how that key is built in Next.js caching explained. Each bug is a way for that key to come out the same for two requests that should be different.

  • Cross-tenant disclosure (high). When the same public 'use cache' function that reads a root parameter is called directly and also through unstable_cache, a concurrent call during a cold cache fill could receive another request's result without its root parameters being checked. That result could then be stored and served until it was revalidated or evicted.
  • Nested cached functions (medium). An inner cached function that reads a root parameter and returns an early value alongside a slower async value could let the outer entry be stored before the inner dependencies were recorded.
  • Binary arguments (medium). Distinct binary arguments could produce the same cache identity. If those bytes identify a user or account, one user could receive another's cached result.
  • Shared shell poisoning (medium). This one only applies to self-hosted next start with Cache Components on and Partial Prefetching off or unset, on a specific route shape with a blocking fallback shell. A crafted URL could store request-specific values in a shell other URLs use, causing wrong content or persistent 404s. The release notes say configurations with Partial Prefetching enabled were not affected in the reported tests.

Self-hosted apps behind a reverse proxy

GHSA-pc58-hwjq-p385 affects self-hosted apps that return an attacker-controlled fetched Response unchanged. The body is forwarded decompressed but with the original compressed framing headers. Behind an HTTP/1.1 reverse proxy that queues pipelined requests on a shared backend connection, responses can end up with the wrong client. The advisory is clear that this needs that specific proxy behavior, not every Nginx setup.

Edge routes that set cookies

App Router Route Handlers and Pages Router API routes on the Edge runtime that call NextResponse.cookies.set() could expose the serialized cookie in the internal x-middleware-set-cookie header. Unlike Set-Cookie, same-origin JavaScript can read that header, so an HttpOnly session cookie was readable by script. Exploiting it still needs attacker JavaScript running on your origin, so it is a way to make an XSS worse, not a new XSS. The release notes say the reproduced leak did not affect Node.js Route Handlers or routes that set cookies through cookies().set().

Image optimization and SVG

An attacker-controlled image from a source you allow in images.remotePatterns could be misclassified as AVIF and get past images.dangerouslyAllowSVG: false, reaching an SVG parser you had chosen to exclude. Your allowlist still applies, and the advisory does not show XSS or remote code execution. It does increase exposure to parser bugs and resource exhaustion. The advisory describes it in terms of self-hosted deployments of /_next/image.

Vercel-hosted vs self-hosted

I want to be careful here because it is easy to over-read. The advisories scope three issues to self-hosted setups: shared shell poisoning (next start), compressed response framing, and the image optimizer. None of them states that Vercel deployments are immune to anything, and the cache and Edge cookie bugs are in the next package itself. My take: upgrade the package wherever you deploy. If you self-host in Docker, as in my Vercel vs self-hosting comparison, rebuild and redeploy the image too, because the fix only lands when the new node_modules ships.

How to check your Next.js version

package.json shows a range. What matters is the version actually resolved in your lockfile:

Terminal
npm ls next

On pnpm use pnpm why next, on Yarn yarn why next. If the output shows anything from 16.0.0 to 16.4.4, or 15.x below 15.5.29, you need to patch. Check every app in a monorepo, since each workspace can resolve its own copy.

How to upgrade

Pin the patched version for your line:

Terminal
# Next.js 16
npm install next@16.4.6

# Next.js 15
npm install next@15.5.29

The official post shows next@16.4.5. Either version includes the fixes, and 16.4.6 adds bug-fix backports on top.

Then run your build, your tests and a smoke test of cached pages, and commit the lockfile so CI's npm ci installs the same version.

How to audit your code for the risky patterns

Upgrading fixes the bugs. Auditing tells you whether you were exposed before, which matters if you handle tenant or account data.

1. A 'use cache' function also wrapped in unstable_cache

This is the high severity pattern. It usually shows up mid-migration, when old unstable_cache wrappers call newer cached helpers:

TypeScript
// lib/tenant.ts
import { unstable_cache } from 'next/cache'

export async function getTenantSettings(id: string) {
  'use cache'
  // reads a root parameter such as the tenant segment
  return db.settings.find(id)
}

// Old wrapper still calling the new cached function
export const getSettingsLegacy = unstable_cache(
  async (id: string) => getTenantSettings(id),
  ['tenant-settings'],
)

The advisory notes that outside the race condition this nesting already throws an error, which is why it can hide in code paths that rarely run. Find candidates:

Terminal
grep -rn "unstable_cache" app lib src --include=*.ts --include=*.tsx
grep -rln "'use cache'" app lib src --include=*.ts --include=*.tsx

Cross-check the two lists. Any function that appears in a 'use cache' file and is called inside an unstable_cache callback should be refactored so it is called one way only. Finishing the move to 'use cache' with cacheLife and cacheTag is the clean fix.

2. Nested cached functions that read root params

Look for a cached function that returns an object mixing an already-resolved value with a promise, where the outer cached caller does not await the promise. If the inner function reads a tenant or locale root parameter, it was in scope for GHSA-vc7v-qv4w-wrv8.

3. Binary arguments to 'use cache'

The advisory gives Uint8Array and Blob as examples. Search for cached functions whose parameters are typed as binary, or that receive hashed tokens or file contents as bytes:

Terminal
grep -rnE "Uint8Array|Blob|ArrayBuffer|Buffer" app lib src --include=*.ts --include=*.tsx

Then check which of those values flow into a 'use cache' function. If a binary value identifies a user, pass a string ID instead. It makes the key obvious and is easier to debug.

4. Cookies set in Edge handlers

Terminal
grep -rn "runtime = 'edge'" app pages src
grep -rn "cookies.set(" app pages src

Any file in both lists is worth reviewing, especially if it sets a session or auth cookie. After upgrading, open DevTools on that route and confirm the response no longer carries an x-middleware-set-cookie header with your cookie in it.

5. Route handlers that proxy a fetch unchanged

Search for handlers that return the result of fetch() directly. If the upstream URL can be influenced by a user, that is the shape GHSA-pc58-hwjq-p385 describes.

6. Remote images and SVG

Review images.remotePatterns in next.config.ts. A tight allowlist limited the image issue before the patch, and it still matters after.

What I would do after patching

If your app serves several tenants or locales from shared 'use cache' functions, consider clearing cached entries after the upgrade, since a poisoned entry lives until it is revalidated or evicted. A redeploy also helps here because 'use cache' keys include the build ID. Then add npm ls next or an advisory check to CI so the next release does not depend on someone reading a blog post.

FAQ

Which Next.js versions fix the November 2026 advisories?

Next.js 16.4.5 for the 16.x line and 15.5.29 for the 15.x line. Any later release on the same line, such as 16.4.6 which shipped on 9 November 2026, also includes the fixes.

Am I affected if I do not use Cache Components?

You are less exposed, but not clear. Four of the seven issues are about Cache Components and use cache. The other three cover cookies set in Edge routes, SVG files slipping past image optimization, and compressed response framing on self-hosted apps, and those reach back into Next.js 15.

What is the high severity issue?

GHSA-mfr8-8qww-v76h. With Cache Components on, calling the same public use cache function both directly and inside unstable_cache can leak one root parameter's cached result, such as one tenant's data, to another during a cold cache fill. It affects 16.3.0 to 16.4.4.

Is there a workaround if I cannot upgrade today?

Only the high severity advisory lists one: stop calling a use cache function inside unstable_cache. The advisory calls that a complete workaround. The other six advisories list no workaround, so upgrading is the fix.

How do I check which Next.js version my app runs?

Run npm ls next in the project. It prints the version actually installed, including copies pulled in by other packages, which is what matters, not the range written in package.json.

Wrapping up

This release is mostly a Cache Components story. The model is powerful, but the cache key is now a security boundary, and anything that blurs it (mixing unstable_cache with 'use cache', binary arguments, unawaited nested values) can leak data between tenants or users. Patch to 16.4.5 or later (or 15.5.29), run the greps above, and if you are halfway through migrating off unstable_cache, take this as the push to finish. For more on how the cache key works, read Next.js caching explained.

  • #nextjs
  • #security
  • #cache-components
  • #caching
  • #deployment

Next.js10 min read

Deploy Next.js: Vercel vs Self-Hosting with Docker

Deploy Next.js on Vercel or self-host with Docker and standalone output. Compare costs, features, caching, ISR and the gotchas before you choose a host.

Read article