Next.js SSRF Vulnerability via WebSocket Upgrade Requests (CVE-2026-44578)
Next.js applications using WebSocket upgrades are vulnerable to server-side request forgery (SSRF) through crafted WebSocket upgrade requests, allowing attackers to proxy requests to internal or external destinations, affecting self-hosted applications running versions npm/next (>= 13.4.13, < 15.5.16) and npm/next (>= 16.0.0, < 16.2.5).
Next.js applications utilizing WebSocket upgrades are susceptible to a server-side request forgery (SSRF) vulnerability. This flaw allows an attacker to craft WebSocket upgrade requests, forcing the server to proxy requests to arbitrary internal or external destinations. This vulnerability is present in self-hosted Next.js applications using the built-in Node.js server. Vercel-hosted deployments are not affected. The vulnerability is present in versions npm/next (>= 13.4.13, < 15.5.16) and npm/next (>= 16.0.0, < 16.2.5). The fix involves applying the same safety checks to WebSocket upgrade handling that already existed for normal HTTP requests, ensuring upgrade requests are only proxied when routing has explicitly marked them as safe external rewrites. This issue is tracked as CVE-2026-44578.
Attack Chain
- The attacker identifies a self-hosted Next.js application utilizing WebSocket upgrades.
- The attacker crafts a malicious WebSocket upgrade request. This request contains a target destination (internal or external) to which the server will be forced to proxy the request.
- The attacker sends the crafted WebSocket upgrade request to the Next.js server.
- The Next.js server, lacking proper validation, processes the malicious upgrade request.
- The server initiates a connection to the attacker-specified destination.
- The server proxies data between the attacker and the target destination.
- The attacker gains access to internal services, cloud metadata endpoints, or other sensitive resources.
- The attacker exfiltrates sensitive information or leverages the access for further malicious activities.
Impact
Successful exploitation of this SSRF vulnerability (CVE-2026-44578) can lead to the exposure of internal services, cloud metadata endpoints, or other sensitive resources. Attackers can potentially gain unauthorized access to sensitive data or internal systems, leading to data breaches, privilege escalation, or further compromise of the affected infrastructure. The number of victims and the specific sectors targeted depend on the deployment and configurations of the vulnerable Next.js applications. Vercel-hosted deployments are not affected.
Recommendation
- Upgrade Next.js to a patched version (>= 15.5.16 or >= 16.2.5) to remediate the vulnerability as described in GHSA-c4j6-fc7j-m34r.
- Deploy the Sigma rule
Detect Suspicious WebSocket Upgrade Requeststo detect potential exploitation attempts by monitoring for suspicious target domains in WebSocket upgrade requests. - If immediate upgrade is not possible, implement the suggested workarounds: do not expose the origin server directly to untrusted networks and block WebSocket upgrades at the reverse proxy or load balancer if they are not required, as described in GHSA-c4j6-fc7j-m34r.
- Restrict origin egress to internal networks and metadata services where possible, as recommended in GHSA-c4j6-fc7j-m34r.
Detection coverage 2
Detect Suspicious WebSocket Upgrade Requests
highDetects suspicious WebSocket upgrade requests potentially indicative of CVE-2026-44578 exploitation, focusing on unusual or internal target domains.
Detect WebSocket Upgrade Requests to Metadata Endpoints
mediumDetects WebSocket upgrade requests targeting common cloud metadata endpoints, which could indicate an SSRF attempt exploiting CVE-2026-44578.
Detection queries are available on the platform. Get full rules →