/

CVE-2026-44578

Severity:

HIGH RISK

(8.6)

SSRF in Self-Hosted Next.js Node Server

CVE-2026-44578

Modified

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Network Pivoting and Internal Service Exposure via SSRF

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Self-hosted Next.js applications running the built-in Node.js server between versions 13.4.13 and before 15.5.16, and 16.x before 16.2.5, can be abused to perform server-side request forgery (SSRF) via crafted WebSocket upgrade requests.

An attacker who can reach the application's HTTP interface may coerce the server into proxying traffic to arbitrary internal or external endpoints, potentially exposing internal services or sensitive cloud metadata APIs.

Affected context

This vulnerability affects self-hosted Next.js deployments that:

  • Run the built-in Node.js server (as opposed to serverless or edge runtimes)
  • Accept WebSocket connections or pass through upgrade requests
  • Are reachable by an attacker over HTTP/HTTPS

In these environments, the HTTP server's handling of WebSocket upgrade requests can be coerced into initiating outbound requests to attacker-specified destinations, including internal network services or cloud provider metadata endpoints. Managed Vercel-hosted Next.js deployments are not impacted because they do not expose the vulnerable server behavior.

Exploit preconditions

  • Attack surface: Public or internal HTTP(S) endpoint of a self-hosted Next.js application using the built-in Node.js server.
  • Required access: Ability to send crafted HTTP requests (including Upgrade: websocket headers) to the Next.js server; no direct access to internal services is required.
  • Trigger point: WebSocket handshake / upgrade handling, where the server interprets or forwards connection details in a way that allows outbound requests to attacker-chosen targets.
  • Why exploitation is possible: The WebSocket upgrade path does not adequately restrict or validate target destinations and trust boundaries, allowing the server to act as a generic HTTP proxy into internal networks or metadata services.

Why this happens

The underlying issue is an SSRF flaw in how the built-in Node.js server in Next.js processes WebSocket upgrade requests.

Within this code path, user-controlled request parameters (such as headers or derived URLs) influence where the server initiates outbound connections, without sufficient validation, allowlisting, or separation between external input and internal destination configuration.

This maps to CWE-918: Server-Side Request Forgery (SSRF), where a server capable of making HTTP requests is tricked into contacting attacker-chosen endpoints, often bypassing network-layer controls and exposing internal resources.

Potential impact

  • Access to internal HTTP services that are not directly reachable from the internet
  • Retrieval of sensitive cloud instance metadata from metadata endpoints (e.g., IAM credentials, tokens, configuration)
  • Enumeration of internal network topology and services via response differences and timing
  • Use of the Next.js server as a pivot point for further attacks inside the infrastructure
  • Potential data exfiltration from internal APIs exposed over HTTP/HTTPS

General mitigation guidance

Effective mitigation patterns focus on constraining where the server can connect and how WebSocket upgrades are handled:

  • Introduce strict allowlists or explicit routing rules for any outbound requests initiated during WebSocket upgrades or proxy-like behavior.
  • Separate configuration for internal service communication from user-controlled inputs, ensuring that external requests cannot influence internal target addresses.
  • Harden network boundaries so that application servers have limited or no direct access to highly sensitive services, especially cloud metadata endpoints.
  • Terminate WebSocket connections at a reverse proxy or gateway that enforces destination restrictions, rather than at the application server itself.
  • Apply the principle of least privilege to network access: avoid granting application servers broad access to internal networks or management planes when not needed.

How teams detect issues like this

Detection can combine code-level and operational techniques:

  • Static analysis rules that flag patterns where outbound requests are constructed from HTTP request fields (headers, query parameters, paths) in WebSocket or upgrade-handling logic.
  • Code review checklists that call out SSRF risks in any proxying, tunneling, or upgrade-handling paths, especially around configurable destinations.
  • Runtime monitoring and logging of outbound HTTP requests from application servers, including destination hostnames, IP ranges, and protocols, to spot anomalous or unexpected endpoints (e.g., metadata service IPs).
  • Network-level controls and IDS/IPS signatures watching for traffic from application servers to sensitive internal ranges or metadata endpoints that would not normally be accessed.
  • Use of application security testing tools (DAST/IAST) that specifically probe SSRF behavior via WebSocket upgrade requests and other upgrade-related endpoints.

Sources

SourceLink
github.comgithub.com/vercel/next.js/security/advisories/GHSA-c4j6-fc7j-m34r
access.redhat.comaccess.redhat.com/errata/RHSA-2026:34608
access.redhat.comaccess.redhat.com/errata/RHSA-2026:37272
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40974
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54435
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-44578
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2477187
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44578.json

Frequently asked

questions

Yes. If a self-hosted Next.js instance using the built-in Node.js server is exposed over the internet, an external attacker who can send HTTP requests to it can attempt to exploit the SSRF behavior via crafted WebSocket upgrade requests.

Not necessarily. Exploitability depends on how the application is configured; if the vulnerable endpoint is reachable without authentication, an attacker does not need valid credentials. If access to the relevant routes is gated by authentication, then those same controls will also gate exploitation.

The safest pattern is to ensure that outbound connections made during WebSocket upgrades cannot be influenced by user input, and to enforce strict allowlists for any server-initiated HTTP requests. Additionally, routing WebSocket traffic through a constrained reverse proxy or gateway that limits destination addresses reduces exposure.

Treat any server capability to make HTTP requests as sensitive: avoid constructing destinations from client-controlled data, enforce allowlists or well-defined routing tables, restrict network access from application servers to only what is necessary, and include SSRF-specific checks in code reviews, threat models, and automated security testing pipelines.

Find out what's already
exploitable in your codebase.