Next.js may leak x-middleware-subrequest-id to external hosts
vercel next.js
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| next npm |
|
|
vercel next.js
| Product | Affected | Fixed in |
|---|---|---|
| next npm |
|
|
Next.js is a React framework for building full-stack web applications. To mitigate CVE-2025-29927, Next.js validated the x-middleware-subrequest-id which persisted across multiple incoming requests. However, this subrequest ID is sent to all requests, even if the destination is not the same host as the Next.js application. Initiating a fetch request to a third-party within Middleware will send the x-middleware-subrequest-id to that third party. This vulnerability is fixed in 12.3.6, 13.5.10, 14.2.26, and 15.2.4.
From the CVE record · GitHub_M
Affected Next.js versions send the x-middleware-subrequest-id header to third parties when Middleware fetches a URL on a different host. The third party can receive the subrequest ID; this requires a Middleware fetch to that host.
Teams running npm next versions >=12.3.5 <12.3.6, >=13.5.9 <13.5.10, >=14.2.25 <14.2.26, or >=15.2.3 <15.2.4 should check their installations.