On a Next.js v16.2.4 server with middleware.ts redirecting unauthenticated requests for /dashboard to /login, GET /dashboard returns 307. GET /dashboard.rsc returns 200 with Content-Type: text/x-component and the protected page's rendered subtree in the body. The App Router renderer treats .rsc as a transport variant of the same page. The middleware matcher regex does not. The only optional suffix in that regex is (\.json)?, which is the Pages Router's data-route convention, the convention App Router replaced.
CVE-2026-44575: Next.js's Middleware Matcher Recognized `.json`. The App Router Routes `.rsc`.
vendor
patterns
cve
proof of concept
The matcher's only optional suffix was \.json
middleware.ts in a Next.js app is a single file at the project root that exports a middleware function and a config.matcher array. The matcher is how the developer tells the framework which requests middleware should run for. The framework compiles that matcher source into a regular expression at build time. At request time, the edge router tests the incoming pathname against that regex. Match, middleware runs. No match, middleware is skipped and the renderer is invoked directly.
Up through v16.2.4, the compiler that produced that regex lived in packages/next/src/build/analysis/get-page-static-info.ts, in a function called getMiddlewareMatchers. The relevant line wrapped the developer's source pattern in a prefix and a suffix:
source = `/:nextData(_next/data/[^/]{1,})?${source}${
isRoot
? `(${nextConfig.i18n ? '|\\.json|' : ''}/?index|/?index\\.json)?`
: '{(\\.json)}?'
}`The trailing group for non-root paths is {(\\.json)}?. That is the entire alphabet of suffixes the matcher accepted. The compiled regex for matcher: '/dashboard/:path*' came out as ^(?:\/(_next\/data\/[^/]{1,}))?\/dashboard(?:\/(?<path>.+?))?(\.json)?[\/#\?]?$. Plain /dashboard matched. /_next/data/<id>/dashboard.json matched. Nothing else did.
.json is the data-route convention from the Pages Router. The Pages Router was the page model Next.js shipped from 2016 through 2022, where a page could be requested as either HTML or as a JSON-serialised props blob at /_next/data/<buildId>/<route>.json. That blob is what getStaticProps and getServerSideProps produced. The matcher's (\.json)? was the gate accommodating that variant.
The App Router shipped in v13.4 (May 2023) and replaced getStaticProps and getServerSideProps with React Server Components. RSC pages do not have a .json data variant. They have a .rsc flight-payload variant, served at /<route>.rsc, and as of the cacheComponents / segment-cache work in v15, a per-subtree variant served at /<route>.segments/$c$children/__PAGE__.segment.rsc. Three years after the App Router shipped, three years into being the recommended page model, the matcher's only optional suffix was the convention App Router replaced. That gap is CVE-2026-44575.
The renderer canonicalizes three transport suffixes. The matcher canonicalized one.
The constants that name the App Router's transport suffixes are not new. They live in packages/next/src/lib/constants.ts and they have been imported by the App Router's request handler since the segment-cache work landed:
export const RSC_SUFFIX = '.rsc'
export const RSC_SEGMENTS_DIR_SUFFIX = '.segments'
export const RSC_SEGMENT_SUFFIX = '.segment.rsc'The renderer reads those three constants to strip the suffix off an incoming URL, look up which page the canonical path resolves to, and produce the right payload type for the suffix it stripped. GET /dashboard.rsc and GET /dashboard.segments/$c$children/__PAGE__.segment.rsc and GET /dashboard all land in the same page module on the server. The renderer treats them as three transport variants of the same logical request.
getMiddlewareMatchers is the other function in this codebase that classifies an incoming URL. It is one directory away. It never imported those constants. It hardcoded \.json and stopped.
The fix for CVE-2026-44575, commit d166096c39 from May 1 2026, is the import that should have happened in 2023. The commit imports RSC_SUFFIX, RSC_SEGMENT_SUFFIX, RSC_SEGMENTS_DIR_SUFFIX from ../../lib/constants and uses them to build the matcher's suffix group:
const APP_ROUTE_RSC_SUFFIX_MATCHER = escapeStringRegexp(RSC_SUFFIX)
const APP_ROUTE_SEGMENT_PREFETCH_SUFFIX_MATCHER =
`${escapeStringRegexp(RSC_SEGMENTS_DIR_SUFFIX)}/.+${escapeStringRegexp(RSC_SEGMENT_SUFFIX)}`
const APP_ROUTE_TRANSPORT_SUFFIX_MATCHER =
`${APP_ROUTE_RSC_SUFFIX_MATCHER}|${APP_ROUTE_SEGMENT_PREFETCH_SUFFIX_MATCHER}`
const MIDDLEWARE_DATA_SUFFIX_MATCHER =
`\\.json|${APP_ROUTE_TRANSPORT_SUFFIX_MATCHER}`The post-patch compiled regex for the same /dashboard/:path* matcher reads ^(?:\/(_next\/data\/[^/]{1,}))?\/dashboard(?:\/(?<path>.+?))?(\.json|\.rsc|\.segments\/.+\.segment\.rsc)?[\/#\?]?$. Same prefix, same wildcard, four allowed suffixes instead of one.
The bypass is one request with two headers
curl -i http://target/dashboard
# HTTP/1.1 307 Temporary Redirect
# location: /login?from=%2Fdashboard
curl -i -H 'RSC: 1' -H 'Accept: text/x-component' \
http://target/dashboard.rsc
# HTTP/1.1 200 OK
# content-type: text/x-component; charset=utf-8
# <flight payload of the rendered protected page>The redirect on the canonical path proves middleware is wired up. The 200 on /dashboard.rsc proves middleware never ran for that URL. The body of that 200 is the same React tree the authenticated user would have seen, serialised as a flight payload. Whatever the protected page renders, that includes any server-fetched data, any prop, any string the developer chose to put on the page assuming middleware would gate it, is in that response. The segment-prefetch URL /dashboard.segments/$c$children/__PAGE__.segment.rsc works the same way for the same reason.
The matcher was the auth gate. The developer wrote middleware to redirect unauthenticated requests for /dashboard to /login because that is what the framework's auth documentation recommends. The framework's auth documentation describes middleware as the place to do authentication checks for groups of routes. There is no warning in that documentation that matcher: '/dashboard/:path*' means the canonical pathname and the .json Pages Router variant but not the .rsc App Router variant, because no developer reading that documentation would model the matcher that way. The developer's mental model is: this matcher governs requests for /dashboard. The framework's model is: this matcher governs the regex we compiled, and we compiled the regex from an enumeration of suffixes we forgot to update when we shipped the App Router.
Parallel implementation gap, applied to URL classification
This is the same shape as Vite's CVE-2026-39363 from last month. Vite had two callers of transformRequest. They agreed on which file to load. They disagreed on whether to consult the server.fs.allow allowlist. The allowlist was the gate. The renderer respected it. The transform did not. Same gate, two enforcement sites, one updated, one not.
Next.js has two functions that classify a URL. The renderer strips .rsc and .segments/.../.segment.rsc and routes to a page. The matcher decides whether middleware runs. They agree the canonical pathname is /dashboard. They disagree on which suffixes count as transport variants of /dashboard. The renderer says three. The matcher said one. The patch updated the matcher to say four.
The sibling CVEs in the v16.2.4 to v16.2.5 release window are the rest of this same family. CVE-2026-44578 was the dev-server's TCP listener parallel to the router-server's RPC listener, where the RPC listener trusted the SSRF check the renderer performed elsewhere. CVE-2026-44574 was middleware behaviour governed by query parameters whose name format nxtP* only one of the two places that parse query parameters knew was internal. Three CVEs, one release, the same shape: two places that classify a request, one of them updated, the other one still on the old vocabulary.
.rsc was internal only by convention, the way x-middleware-subrequest was
There is no public documentation telling developers their middleware will be skipped on .rsc URLs. The .rsc suffix is described in framework internals as transport, not as a routable URL surface. Developers do not write links to /dashboard.rsc. The Next.js client writes those URLs, fetches them, parses the flight payload, and merges it into the page. They are internal.
Internal in the sense that the framework's own components produce and consume them. Not internal in any sense the network respects. They are HTTP requests to the same listener that serves /dashboard. Any client can send them. The matcher's job was to be the one component that classified them correctly anyway.
This is the same pattern that produced CVE-2025-29927 last year, where x-middleware-subrequest was the header the framework set on itself to break recursion and the network was permitted to set it too. The header was internal by convention. The matcher's enumeration of suffixes is internal by the same kind of convention: a list of URL shapes the framework knows it produces, treated as if the network would only send what the framework produces. The patch in 2025 was to require a token on the header so the network could not forge it. The patch in 2026 is to recognise the URL shapes the framework's own client sends, so the framework does not skip the gate when its own URL conventions are spoken back to it.
The thing that makes both bugs the same bug is the developer's understanding of /dashboard. The developer wrote middleware for /dashboard. The matcher recognised the URLs the framework's documentation prepared the developer for. The URLs the framework's later releases taught its own client to send were never added to that list.
Next.js shipped the App Router and updated one of the two functions that classify URLs. The one it did not update was the gate.