Next.js vulnerable to Denial of Service via connection exhaustion in applications using Cache Components
Affected releases · next
- 16.x16.0.0 – 16.2.4Fixed in 16.2.5
- 15.x15.0.0 – 15.5.15Fixed in 15.5.16
On 16.x, the newest line:
npm install next@16.2.5Affected
16.0.0 – 16.2.4
25 releases
Fixed
16.2.5 – 16.4.2
20 releases, latest
Affected
15.0.0 – 15.5.15
70 releases
Fixed
15.5.16 – 15.5.28
12 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
Impact
Applications using Partial Prerendering through the Cache Components feature can be vulnerable to connection exhaustion through crafted POST requests to a server action. In affected configurations, a malicious request can trigger a request-body handling deadlock that leaves connections open for an extended period, consuming file descriptors and server capacity until legitimate users are denied service.
Fix
We now treat the header used for resuming Partial Prerendered requests as an internal-only header and strip it from untrusted incoming requests. This header should never be accepted directly from external clients.
Workarounds
If you cannot upgrade immediately, block requests that would be handled by Next.js if they contain the Next-Resume header at the edge.