Next.js: HTTP request smuggling in rewrites
Affected releases · next
- 16.x16.0.0 – 16.1.6Fixed in 16.1.7
- 15.x15.0.0 – 15.5.12Fixed in 15.5.13
- 14.x14.0.0 – 14.2.35No fix on this line yet
- 13.x and older9.5.0 – 13.5.11No fix, no longer updated
On 16.x, the newest line:
npm install next@16.1.7Affected
16.0.0 – 16.1.6
19 releases
Fixed
16.1.7 – 16.4.2
26 releases, latest
Affected
15.0.0 – 15.5.12
67 releases
Fixed
15.5.13 – 15.5.28
15 releases
Affected
14.0.0 – 14.2.35
46 releases
Affected
13.0.0 – 13.5.11
56 releases
Affected
12.0.0 – 12.3.7
33 releases
Affected
11.0.0 – 11.1.4
7 releases
Affected
10.0.0 – 10.2.3
18 releases
Not affected
9.0.0 – 9.4.4
32 releases
Affected
9.5.0 – 9.5.5
6 releases
Is your project affected?
Paste your package.json, or type the range you declare for next. It is read in your browser and sent nowhere.
What happens
Summary
When Next.js rewrites proxy traffic to an external backend, a crafted DELETE/OPTIONS request using Transfer-Encoding: chunked could trigger request boundary disagreement between the proxy and backend. This could allow request smuggling through rewritten routes.
Impact
An attacker could smuggle a second request to unintended backend routes (for example, internal/admin endpoints), bypassing assumptions that only the configured rewrite destination/path is reachable. This does not impact applications hosted on providers that handle rewrites at the CDN level, such as Vercel.
Patches
The vulnerability originated in an upstream library vendored by Next.js. It is fixed by updating that dependency’s behavior so content-length: 0 is added only when both content-length and transfer-encoding are absent, and transfer-encoding is no longer removed in that code path.
Workarounds
If upgrade is not immediately possible:
Block chunked
DELETE/OPTIONSrequests on rewritten routes at your edge/proxy.Enforce authentication/authorization on backend routes per our security guidance.