Skip to main content
Lead Generation Websites, Google Maps Ranking, WhatsApp Funnels, Ecommerce, SEO, Web DesignSpeed Optimization · Conversion Optimization · Monthly Lead Systems · AI AutomationLead Generation Websites, Google Maps Ranking, WhatsApp Funnels, Ecommerce, SEO, Web Design
November 18, 202611.18.26

Cache Components Cross-Tenant Leak Audit Before Enabling It

A staged audit for Next.js Cache Components: what 2026 security releases fixed in use cache, how to test your app, and how to roll out safely.

Cache Components Cross-Tenant Leak Audit Before Enabling It

Next.js Cache Components are safe to adopt only if every use cache scope in your app has a clear answer to one question: what decides which user or tenant receives this stored result? Next.js 16.4 now recommends Cache Components for every app, and between 30 September and 3 November 2026 the Next.js team fixed five cache-isolation bugs in use cache, two in September and three in November. Here's how to audit your own code for that class of mistake before you switch the feature on. Everything reflects what nextjs.org and the GitHub advisories said on 6 November 2026, so re-read them before you act.

If you want the wider case for giving a Next.js site an owner for updates, our Next.js 2026 security and performance guide covers it. This article stays on the cache.

Next.js Cache Components: what 16.4 actually recommends

The Next.js 16.4 release post, dated 6 October 2026, recommends Cache Components as the best choice for every Next.js app. It enables them by default in apps created with create-next-app and says they become the default in Next.js 17. For an existing app that means a migration to plan, not a deadline today.

Cache Components let you mark parts of a component tree as cacheable with the use cache directive. The release post describes it as a component-level version of the Cache-Control header. You turn it on with cacheComponents: true, and the docs tell you to set partialPrefetching explicitly alongside it.

The security model sits in the cache key. The docs say a key is built from the build ID (or deploymentId if you set one), a hash of the function's location and signature, its serializable arguments, and any outer-scope variables it captures. A function that reads root parameters adds only the ones it actually reads. Anything that should separate two users but is missing from that list means both users can share one entry.

What was fixed between September and 3 November

Five of these fixes concern cache isolation in use cache. A sixth, from November, touches only self-hosted apps but also involves Cache Components. Each row carries the conditions its advisory states.

Fixed inIssueStated conditions
30 Sep: 16.3.8, 15.5.27Nested use cache keyed without a root param (Medium, GHSA-h694-7cp9-m8p3)Cache Components on; a cached function calls another cached function that reads a root param. Leaked values can't be chosen by an attacker. No known workaround. GitHub lists affected versions as 16.3.0 up to, not including, 16.3.8.
30 Sep: 16.3.8, 15.5.27Draft Mode content leaking into regular responses (Medium, CVE-2026-94544)Cache Components or experimental.useCache on; Draft Mode previews served; cached functions return draft-dependent content. Unpublished content can be persisted into a generated page. GitHub lists 16.3.0 up to, not including, 16.3.8.
3 Nov: 16.4.5, 15.5.29Cross-tenant disclosure combining unstable_cache and use cache (labelled High in the release post, Moderate with CVSS 6.3 on GitHub, GHSA-mfr8-8qww-v76h)The same public cached function is called directly and from inside unstable_cache, and it reads a root param such as a tenant ID. GitHub: needs a request to arrive during the first fill after a process start, and avoiding the nesting is a complete workaround. Affected: 16.3.0 to 16.4.4.
3 Nov: 16.4.5, 15.5.29Cross-root-parameter disclosure in nested cached functions (Medium, GHSA-vc7v-qv4w-wrv8)An inner cached function reads a root param and returns an early value alongside a slower async value, and the outer function finishes first. GitHub calls it a variant the September fix does not cover. Affected: 16.2.0 to 16.4.4.
3 Nov: 16.4.5, 15.5.29Cross-user disclosure and poisoning through binary arguments (Medium, GHSA-rhh4-g77r-r9qj)Distinct binary arguments, such as a Uint8Array or Blob, can produce the same cache identity. Matters only if you use them to tell users or accounts apart. Affected: 16.0.0 to 16.4.4.
3 Nov: 16.4.5, 15.5.29Shared shell cache poisoning (Medium, self-hosted only)next start with Cache Components on and Partial Prefetching disabled or unset, plus a specific route shape. The post says build-generated values and Partial Prefetching enabled were not affected in the reported tests.

The GitHub pages I read give affected ranges for the 16.x line only. The release posts also name 15.5.27 and 15.5.29 as fixed versions for the 15.5 line, so treat 15.5 as patched there and check the advisory before assuming more. The advisories do not limit the three cross-tenant bugs to self-hosted setups, so I'm not claiming any host is exempt. Ask yours.

Separately, the 14 October release (16.4.1 and 15.5.28) fixed a critical unauthenticated remote code execution bug in apps where a use cache function returns multiple typed arrays, with no known workaround. It's a different problem from the leaks, but one more reason to be on the latest patch before you enable the feature. As of 6 November, npm lists 16.4.5 as the latest release.

Key figures from the 2026 Next.js security releases

  • 3 of 7 issues in the 3 November 2026 release concern use cache identity or cross-tenant disclosure (counted from the headings in the Next.js November 2026 Security Release).
  • 2 of 7 issues in the 30 September 2026 release concern cache isolation in use cache: a nested root-param leak and Draft Mode content (counted from the headings in the Next.js September 2026 Security Release).
  • 15 minutes server-side revalidate, never expires by time: the default cacheLife profile when a use cache scope sets none, per the Next.js use cache documentation (page last updated 29 September 2026).

Where a cross-tenant leak can hide in your own code

I look in these places first. They come straight from the docs and the advisories above.

  • File-level directives. Putting use cache at the top of a file caches every export. A helper someone adds next month is cached too.
  • State outside the key. Arguments and captured variables are in the key. A module-level variable or singleton is not.
  • Request-specific data. Cached scopes can't call cookies() or headers(). The docs say to read them outside and pass the value in. That value becomes part of the key, so a session ID creates one entry per session.
  • Tenant from the hostname. Because headers aren't readable inside the scope, the tenant has to arrive as an argument or a root param. Root params are the dynamic segments that sit before the root layout, readable through next/root-params.
  • Nested cached functions. Both root-param bugs involved an inner cached function reading a root param inside an outer one.
  • unstable_cache around a cached function. GitHub calls this nesting unsupported.
  • Binary identifiers. Avoid passing bytes or blobs as the thing that identifies a user.
  • Draft Mode. The docs say cached scopes re-run on every Draft Mode request and aren't saved. The September bug came from overlapping pending fills, so check any cached function whose output depends on draft content.

For per-user data, the docs also describe use cache: private, which can read cookies and headers directly and, in production, doesn't store results in a server cache across requests. If you're fuzzy on the older caching layers, our explainer on Next.js caching, revalidation and tags is useful background. Per the 16.4 post, Cache Components replace the implicit caching of earlier App Router versions.

Not sure which of your cached scopes touch tenant or user data? We'll map them before you change a flag.

Ask for a Cache Components readiness audit

A step-by-step Next.js Cache Components audit

  1. Patch first. Move to 16.4.5 or later on a branch, or 15.5.29 on the 15.5 line, before enabling anything. Auditing on an unpatched version just rediscovers bugs the framework already fixed.
  2. Inventory every scope. Search for use cache, including file-level directives and the remote and private variants.
  3. Write down each scope's inputs. List its arguments, captured variables, root params read, and whether its output contains tenant or user data.
  4. Make identity explicit. Anything tenant- or user-specific should receive that identity as a plain string argument, never as bytes.
  5. Remove use cache from inside unstable_cache. GitHub names this as a complete workaround for that one issue.
  6. Flatten nested cached functions that read root params. Passing the root param down explicitly at every level is defensive design on my part. It doesn't replace the patch, since Next.js lists no workaround for the September nested bug.
  7. List draft-dependent cached functions. You'll test those separately.
  8. Set cacheLife in every scope. The docs recommend it, and it caps how long any mistake can live.

Here's a hypothetical example. A booking platform serves acme and globex from one deployment. This version is risky because the tenant never reaches the cache key:

async function getServices() {
  'use cache'
  return db.services.findMany({ where: { tenant: currentTenant } })
}

This version makes the tenant a visible input:

async function getServices(tenantId: string) {
  'use cache'
  cacheLife('hours')
  return db.services.findMany({ where: { tenant: tenantId } })
}

How to test your Next.js Cache Components app for leaks

Run these on your own staging site with synthetic data, never on production or anyone else's site.

  1. Plant markers. Create two test tenants and give each a unique string in its data, such as MARKER-ACME and MARKER-GLOBEX. A leak then shows up as one marker on the other tenant's page.
  2. Test a production build. Use next build then next start. The docs warn that some cached-scope errors pass the build and fail under next start.
  3. Test a cold start. Restart the process, then immediately send alternating requests for both tenants at once. The unstable_cache issue depends on the first fill after a process start, so a warm cache hides it.
  4. Test Draft Mode overlap. Enable Draft Mode in one session, load a route that wasn't prerendered at build time, and load the same route anonymously at the same moment. Then check the generated page for a draft-only marker.
  5. Check shared caches. GHSA-h694-7cp9-m8p3 notes that shared cache headers let downstream caches redistribute wrong content, so inspect what your CDN stores.
  6. Turn on cache logging. The docs describe NEXT_PRIVATE_DEBUG_CACHE=1 for verbose cache output in staging.

Passing means no marker appears on the wrong tenant across repeated runs. It doesn't prove the absence of other bugs, which is why the patch cadence below matters. For multi-tenant products like this, a custom web application build should include these tests from day one.

Roll out Cache Components in stages

  1. Stage 0: patch and baseline. Upgrade, run your existing tests, and record current response times.
  2. Stage 1: staging only. Enable cacheComponents and set partialPrefetching explicitly. The November shell-poisoning issue named Partial Prefetching disabled or unset.
  3. Stage 2: public, tenant-neutral pages. Marketing pages and blog content carry the least risk.
  4. Stage 3: tenant-scoped pages. Add them only after the marker tests pass.
  5. Stage 4: authenticated pages last. Leave them uncached, or use the private variant, until you've reviewed each one.

Keep the previous release deployable. Don't assume switching the flag off is a clean undo once code uses use cache.

Watch: Hands On: How To Migrate To Next.js 16 and "Use Cache” (Vercel)

Vercel's migration walkthrough dates from November 2025, before the fixes above, so use it for mechanics, not security status.

https://www.youtube.com/watch?v=Bk0ZAi2aV5w

Keep watching after launch

The Next.js team announced the November release a week ahead, on 27 October. It said the release would address seven vulnerabilities and published the details on 3 November. Follow the Next.js security posts and the vercel/next.js GitHub advisories, and read each one against your feature list: Cache Components on or off, self-hosted or not, root params in use or not.

Add a canary of your own too. A scheduled check that requests each test tenant's page and fails if another tenant's marker appears will catch a regression you didn't write. The 16.4 release also adds next upgrade --agent and reminders through experimental.agentUpgrade, whose default policy reminds you about upgrades that address known vulnerabilities. Useful, but a person should still read any diff that touches cached scopes.

Patches like these arrive on the framework's schedule, not yours. We can watch them for you.

Add patch monitoring to your maintenance plan

Reference reading

Frequently Asked Questions

Should I enable Next.js Cache Components now?

You don't have to. Next.js 16.4 recommends Cache Components and says they become the default in Next.js 17, so there's time to plan. Patch to a current release, audit your cached scopes, and move in stages. A tenant-neutral marketing site can go first.

Do these cache leaks affect every Next.js app?

No. The advisories describe apps with Cache Components or use cache enabled, plus specific conditions such as root params, unstable_cache nesting, binary arguments or Draft Mode previews. An app that doesn't use the feature isn't in the scope those advisories describe.

Which Next.js versions contain the fixes?

The September release fixed the first two issues in 16.3.8 and 15.5.27. The 3 November release fixed the other three in 16.4.5 and 15.5.29. As of 6 November, check nextjs.org for anything newer than 16.4.5.

Can I work around these without upgrading?

For one issue, yes: GitHub says removing the nesting of use cache inside unstable_cache is a complete workaround. For the September nested root-param bug and the October typed-array bug, the advisories list no known workaround, so upgrade.

Does Draft Mode make cached content unsafe?

Not by itself. The docs say cached scopes re-run on every Draft Mode request and aren't saved. The September bug was about overlapping pending cache fills, fixed in 16.3.8 and 15.5.27. Sites that preview drafts through cached functions should still test the overlap case.

Comments

Leave a Comment

Loading comments...