Nuxt _payload.json: A Redirect Is Not Access Control

On November 24, 2026 the Nuxt team published advisory GHSA-jxc9-w3j6-pwp2, fixed in Nuxt 4.7.0 (released November 23). In short: in some configurations, a page’s route rules were not applied to the page’s payload URL, /<page>/_payload.json. If a redirect or a proxy rule was what kept people away from a page, the payload URL could hand them the page’s data anyway.

The bug is fixed, but the lesson is wider than Nuxt: route rules, redirects and edge config decide where traffic goes. They don’t decide who may see the data.

1. What happened

Nuxt pages that fetch data on the server with useFetch or useAsyncData also have a payload URL, which returns that data as JSON for client-side navigation. The advisory says route rules set for a page’s own path were not applied to that payload URL. When a catch-all rule cached pages, the payload URL fell back to the catch-all rule and rendered the page.

The advisory’s own example:

export default defineNuxtConfig({
  routeRules: {
    '/**': { swr: 60 },
    '/admin': { redirect: '/login' },
    '/internal': { proxy: 'http://127.0.0.1:4180/gated', headers: { 'x-frame-options': 'DENY' } },
    '/account': { isr: false },
  },
})

Here GET /admin redirects and GET /internal is proxied, but /admin/_payload.json and /internal/_payload.json render those pages on the server and return 200 with the fetched data, without the configured headers. /account is not cached, but /account/_payload.json comes back with the cache headers of the '/**' rule.

Are you affected?

According to the advisory, both of these must be true:

  • an isr, swr or cache rule covers the payload URL, typically a catch-all such as '/**': { swr: 60 };
  • a page has a rule for its exact path, a dynamic path ('/users/:id/billing') or, with nitropack 2, a single-segment wildcard ('/team/*') that sets redirect, proxy, headers, cors or ssr: false, or excludes it from caching with isr: false, cache: false or swr: false.

A rule with a wildcard that already covers the payload URL, such as '/admin/**', is not affected. Setting experimental.payloadExtraction: false does not help on affected versions.

What can leak depends on which rule was skipped:

  • redirect or proxy used as a gate: anyone can request the payload URL and read what the page fetches on the server, such as data from internal APIs or data fetched with server-side credentials.
  • Cache exclusions on isr deployments: isr renders receive the request’s cookies. If the page fetches user-specific data and a shared cache such as a CDN stores the response, one user’s data can be served to others. A signed-in user has to open the payload URL, for example via a link; the advisory notes that a SameSite=Lax session cookie is sent on a top-level navigation from another site.
  • headers: security headers set for the page are missing from the payload response.

Versions, severity, fix

  • Severity: Moderate, CVSS 3.1 score 6.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N). The advisory lists no CVE ID at the time of writing.
  • Affected: all Nuxt 3 and 4 releases before 4.7.0. The vulnerable code lives in @nuxt/nitro-server from Nuxt 3.20.0 and 4.2.0 onward, and in the nuxt package itself before that.
  • Fixed in: nuxt 4.7.0 (via @nuxt/nitro-server 4.7.0). The payload URL (_payload.json, or _payload.js when experimental.renderJsonPayloads is false) now gets the page’s isr, cache, swr, redirect, proxy, headers and cors rules and its resolved ssr value.
  • Nuxt 3 will not get a fix: it has reached end of life. Use the workaround below, and plan the move to Nuxt 4.

The 4.7.0 release fixes two more advisories: encoded slashes on catch-all routes (GHSA-vrh2-cfcx-c3fg, medium) and dev server runtime config exposure (GHSA-h5xj-x893-p5f7, low, development only).

To upgrade, the release notes recommend:

npx nuxt upgrade --dedupe

Note that Nuxt 4.7 requires vue ^3.5.46, which this command updates too.

Workaround if you can’t upgrade yet: next to each exact-path rule, add a wildcard rule with the same value so it covers the payload URL. For '/team/*', add '/team/**'.

routeRules: {
  '/**': { swr: 60 },
  '/admin': { redirect: '/login' },
  '/admin/**': { redirect: '/login' },
  '/account': { isr: false },
  '/account/**': { isr: false },
}

After upgrading or applying the workaround, purge your CDN or edge cache if pages with personal data may already have been cached. Both the advisory and the release notes ask for this.

2. Quick self-check

Note: these commands are my own untested examples, not from the advisory. Run them only against sites you own, from a browser or machine that isn’t logged in.

Take every page in routeRules that has a redirect, proxy, headers, cors, ssr: false or a cache exclusion, and compare the page with its payload URL:

SITE=https://www.example.com

for p in /admin /internal /account; do
  echo "== $p"
  curl -s -o /dev/null -w "page:    %{http_code} %{redirect_url}\n" "$SITE$p"
  curl -s -o /dev/null -w "payload: %{http_code}\n" "$SITE$p/_payload.json"
  curl -sI "$SITE$p/_payload.json" | grep -iE '^(cache-control|x-frame-options|content-security-policy):'
done

Warning signs: the page redirects (301/302) but the payload returns 200 with data; a page you excluded from caching has a payload with a long cache-control; or security headers present on the page are missing from the payload. If the payload URL returns 404 or follows the same redirect, that page looks fine. A clean result from curl doesn’t replace upgrading, though.

3. The general lesson: route rules route traffic

A redirect rule says “send visitors of this URL elsewhere.” It doesn’t say “this data is private.” The same goes for proxy rules, CDN path rules, nginx location blocks and framework middleware. They match URLs, and the same data is often reachable through another URL: a payload file, an RSC payload, a JSON API, a preview route.

The advisory makes the same point. Access checks in server middleware, in route middleware attached with definePageMeta, or in the API the page fetches from are not affected, and the advisory calls them “the more robust place to enforce access.”

In practice:

  • Check access where the data is returned. In a Nuxt server route, check the session before you query anything, and return 401/403 otherwise.
  • Don’t fetch privileged data during SSR on a page whose only protection is a redirect. If the page’s server render can reach an internal API with server-side credentials, anything that renders that page can read it.
  • In headless WordPress, the same rule applies to the CMS. Hiding /wp-json/ behind the frontend’s routing doesn’t protect it if the CMS origin is public. Authorization belongs in WordPress: in REST permission callbacks, or in a filter that limits anonymous REST access.

A minimal Nuxt server route that checks access itself (my own untested example; getUserSession depends on your auth module, e.g. nuxt-auth-utils):

// server/api/account.get.ts
export default defineEventHandler(async (event) => {
  const { user } = await getUserSession(event)
  if (!user) {
    throw createError({ statusCode: 401, statusMessage: 'Unauthorized' })
  }
  setResponseHeader(event, 'cache-control', 'private, no-store')
  return await getAccountFor(user.id) // your data access function
})

4. Caching risks

The advisory narrows the cross-user risk more than you might expect:

  • isr renders receive the request’s cookies. With a shared cache such as a CDN, a page that fetches user-specific data can end up cached and served to others.
  • swr and cache render through Nitro’s built-in cache, which doesn’t pass request headers to the render. Cookie-derived data doesn’t cross users there, but data from event.context set by server middleware may.

The broader point is about catch-all rules. '/**': { swr: 60 } is convenient, but it makes every page cacheable by default, and every exception has to be remembered and written correctly. For apps with logged-in areas, consider the reverse: cache the public paths explicitly ('/blog/**', '/') and leave everything else uncached. Responses with personal data should send cache-control: private, no-store from the server handler, so a CDN won’t store them even when a rule is wrong.

5. The same audit for Next.js and the WordPress REST API

Next.js: Proxy (formerly middleware)

In Next.js 16, the middleware file convention is deprecated and renamed to proxy. The Next.js authentication guide says Proxy is fine for optimistic checks, such as reading the session cookie and redirecting, but “should not be your only line of defense in protecting your data.” It recommends doing most security checks “as close as possible to your data source,” in a Data Access Layer.

The guide also warns about layouts: a layout doesn’t control whether the rest of the route renders, so a layout that hides child segments doesn’t stop them from running or from appearing in the RSC payload. That’s the same lesson as _payload.json, in a different framework.

Questions for a review:

  • Does every Route Handler, Server Action and data function that returns private data check the session itself?
  • Is any auth check living only in proxy.ts/middleware.ts, or only in a layout?
  • Does the Proxy matcher exclude paths that actually need protecting? (For auth, the guide recommends running Proxy on all routes.)

Next.js: use cache

According to the Next.js docs, a use cache function can’t read cookies() or headers(). You read them outside and pass values as arguments, which become part of the cache key. That’s the safe pattern, but it puts the burden on you: anything that separates users or tenants has to be in the arguments.

The Next.js November 2026 security release (16.4.5 and 15.5.29) also fixed several use cache bugs where content could be served across tenants, root-parameter values or users, including a High severity cross-tenant disclosure (GHSA-mfr8-8qww-v76h) when the same use cache function is called both directly and from unstable_cache. If you use Cache Components, make sure you’re on a patched version, and check that cached functions don’t return per-user data unless the user is part of the key.

WordPress REST API: the 7.1.5 fixes

WordPress 7.1.5 (November 18, 2026) fixed several REST API disclosure issues worth checking on a headless CMS:

  • Private taxonomy terms via the REST search endpoint (Medium, GHSA-rcr3-43fx-wqfv). No login needed: combining the term search type with a post subtype returned terms from every taxonomy, including private ones such as navigation menus.
  • User emails via the comments endpoint (Low, GHSA-jq8m-j7jq-c53m). Needs an Author account or higher, not anonymous access.
  • Author data via post and template author assignment (Low, GHSA-v7qc-72mg-wgpc). Multisite only; the release notes list it as Editor+.

Update to 7.1.5 or your branch’s backport. Then check what the API shows to anonymous visitors (my own untested examples):

CMS=https://cms.example.com
curl -s "$CMS/wp-json/" | jq '.routes | keys | length'
curl -s "$CMS/wp-json/wp/v2/users" | jq '.[]? | {id, name, slug}'
curl -s "$CMS/wp-json/wp/v2/search?type=term&search=a" | jq '.[]? | {id, title, type, subtype}'

I covered these fixes and how to limit anonymous REST access in more detail in WordPress 7.1.5: Lock Down Your Headless CMS API.

6. Checklist for a headless-site security review

  1. Versions. Nuxt 4.7.0+, Next.js 16.4.5 / 15.5.29+, WordPress 7.1.5 or your branch’s backport. Nuxt 3 apps: workaround now, migration plan next.
  2. Route rules. List every redirect, proxy, headers, cors, ssr: false and cache exclusion. Is any of them doing the job of access control?
  3. Payload URLs. Request /<page>/_payload.json for those pages and compare status, data and headers with the page.
  4. Catch-all caching. Is there a '/**' swr/isr/cache rule? Do pages with personal data send private, no-store?
  5. Authorization at the source. Server routes, Route Handlers, Server Actions and WordPress REST endpoints check the session themselves.
  6. Middleware/Proxy and layouts. No check lives only there.
  7. use cache. User and tenant identifiers are arguments, never assumed.
  8. CMS origin. Anonymous REST access limited to what the frontend reads; admin and XML-RPC not public.
  9. CDN. Purge after fixing anything cache-related.

7. Want a second pair of eyes?

If you run a Nuxt, Next.js or headless WordPress site and aren’t sure what its route rules and API actually protect, I offer a free “first look”: a quick review that highlights weak points such as redirect-only gates, catch-all caching or an open CMS API. It’s not a full audit, but it shows where to start. Get in touch, and I’ll reply within one working day.


Sources:

  • Nuxt advisory GHSA-jxc9-w3j6-pwp2 — https://github.com/nuxt/nuxt/security/advisories/GHSA-jxc9-w3j6-pwp2
  • Nuxt v4.7.0 release — https://github.com/nuxt/nuxt/releases/tag/v4.7.0
  • Next.js authentication guide — https://nextjs.org/docs/app/guides/authentication
  • Next.js proxy file convention — https://nextjs.org/docs/app/api-reference/file-conventions/proxy
  • Next.js use cache directive — https://nextjs.org/docs/app/api-reference/directives/use-cache
  • Next.js November 2026 Security Release — https://nextjs.org/blog/november-2026-security-release
  • WordPress 7.1.5 Release — https://wordpress.org/news/2026/11/wordpress-7-1-5-release/
  • WordPress security advisories (wordpress-develop) — https://github.com/WordPress/wordpress-develop/security/advisories