← All posts

NGINX2Root: Patch nginx and Shield Your Origin

Diagram: visitors connect to the Cloudflare edge, only a new connection reaches the origin server, the direct path is blocked by a firewall

In many organisations, nginx runs in more places than the server inventory suggests. It serves websites, sits in front of customer portals and APIs, and often works as a reverse proxy: a server placed in front of your applications that accepts requests from the internet and passes them on. A vulnerability in this layer therefore rarely affects just one application.

On 18 November 2026 the nginx project released updates for ten security vulnerabilities (nginx security advisories). The security firm Xint described five of them under the name NGINX2Root. There is no question that you need to patch nginx. The open question is how to limit access to vulnerable components until every system has been updated. This article reflects the situation as of 21 November 2026.

What NGINX2Root is about

The Xint analysis covers five nginx vulnerabilities: two in HTTP/2 handling and one each in HTTP/3, the resolver used for DNS lookups and the mail proxy. Depending on the configuration, they allow remote code execution, meaning an attacker can run their own commands on the server from afar. Those commands initially run with the privileges of the nginx worker process handling the request. Root access takes a further step. For that, Xint chains the nginx flaws with a separate vulnerability in the Linux kernel's SCTP subsystem; in the researchers' tests this even broke out of a Docker container.

CVE-2026-123007 illustrates the HTTP/2 problem. nginx rates this memory corruption in HTTP/2 flow control as "major"; versions 1.9.5 to 1.31.8 with HTTP/2 enabled are affected. It is triggered by manipulated protocol control frames, and according to Xint the attacker does not need to log in. This is why well-written application code is of little help here: the attack hits the web server's protocol handling before your application ever sees the request.

Whether a system is actually exploitable depends on three factors: patch level, enabled features and reachability. The resolver flaw, for example, requires a specific combination of a variable proxy_pass and mirror requests, and the mail flaw an active mail proxy with auth_http. Not every nginx installation is directly exploitable.

The fixed releases are nginx Open Source 1.30.7 (stable) and 1.31.9 (mainline), plus NGINX Plus 37.0.8.1 (LTS) and 37.3.0.1 (continuous release). On Linux distributions the version number alone is not enough, because fixes are often backported to older versions. What counts is the full package version listed in your distribution's advisory.

As of 19 November, according to Cloudflare, none of the five flaws was listed in the US agency CISA's catalogue of known exploited vulnerabilities, and there were no reports of attacks. Rapid7 has, however, already published a proof of concept. If you cannot update straight away, temporarily disable HTTP/2 (http2 off; from nginx 1.25.1). According to Xint, this blocks the two HTTP/2 flaws, but it does not replace the update.

How Cloudflare intercepts the dangerous connections

If a hostname is proxied through Cloudflare, the browser opens its HTTP/2 or HTTP/3 connection to Cloudflare. That is where it ends. For the path to your origin, meaning the server on which nginx and your application run, Cloudflare opens a separate connection. The protocol frames an attacker controls therefore do not reach nginx unchanged. In its analysis, Cloudflare describes this as protection against the HTTP/2 and HTTP/3 attack paths, even when Cloudflare itself talks to the origin over HTTP/2.

This effect comes from terminating the connection, not from the web application firewall. According to Cloudflare, WAF rules explicitly play no role for these flaws, and there is no dedicated managed rule for them.

The prerequisite is that web traffic actually flows through Cloudflare. With a classic DNS setup, every affected web hostname must be set to "Proxied". A record with the status "DNS only" returns your server's real IP address, and HTTP traffic goes straight there (Cloudflare documentation). Using Cloudflare only as a DNS provider does not protect nginx.

Closing the direct path to the origin

The proxy only shields nginx as long as attackers cannot reach your origin directly. If the server still answers on its public IP address, an attacker simply goes around Cloudflare. Two connection models close this path.

Option A: Cloudflare Tunnel

With Cloudflare Tunnel, a connector called cloudflared runs in your network. It opens outbound connections to Cloudflare, over which Cloudflare delivers the requests. The origin therefore needs no publicly reachable inbound ports. As the target state, Cloudflare describes blocking all inbound traffic and allowing only outbound traffic from cloudflared.

This does not happen by itself. A new tunnel does not close existing firewall rules, port forwards or security group rules. You remove them deliberately and then check that the application is reachable through the tunnel while the external IP address no longer answers.

Option B: Origin with a controlled public connection

If the origin deliberately keeps a public address, for example behind a cloud provider's load balancer, a network firewall or security group restricts web access to Cloudflare's IP ranges. This filtering belongs in the IP firewall. A block in the nginx configuration would come too late, because it only applies after the vulnerable protocol handling has already run.

In addition, Cloudflare identifies itself to your server with a client certificate via Authenticated Origin Pulls (AOP). AOP only works if the origin requires and verifies this certificate. The global Cloudflare certificate merely proves that a request comes from the Cloudflare network, possibly from another Cloudflare account. To tie access to your own account, you need your own certificate at zone or hostname level.

Choose Full (strict) as the TLS mode. Cloudflare then encrypts the path to the origin and validates its certificate. On its own, this mode does not prevent direct access; the firewall and AOP do that. Tunnel and AOP are two separate connection models. For hostnames behind Cloudflare Tunnel, AOP settings have no effect.

Securing admin interfaces with Cloudflare Access

Your website stays publicly reachable. Admin interfaces, internal tools and test environments, which often run behind nginx as well, are a different matter. Here, Cloudflare Access puts an identity and access check in front of the application. Users sign in through your identity provider, for example with their company account and MFA. Cloudflare stops requests without a valid login before they reach the server.

A published tunnel does not come with user authentication; without an Access application, anything you publish through the tunnel is reachable by anyone on the internet. You need an Access application with suitable policies and validation of the Access token, either by cloudflared or at the origin.

The measures at a glance

The table separates what works specifically against the nginx attack paths described here from features with a general protective benefit.

Measure

Benefit

Keep in mind

nginx security update

Specific: fixes the flaws at the root

Requires a restart or binary upgrade, a reload is not enough; check distribution packages against the advisory

Cloudflare HTTP proxy

Specific: keeps manipulated HTTP/2 and HTTP/3 frames away from nginx

Only for hostnames set to "Proxied"; resolver, mail proxy and Spectrum are not fully covered

Cloudflare Tunnel

Specific: origin without public inbound ports

Close existing rules deliberately; AOP has no effect here

Origin firewall and Authenticated Origin Pulls

Specific: only Cloudflare reaches the origin

Filter in the IP firewall, not in nginx; enforce AOP at the origin, use your own certificate

Cloudflare Access

General: login with MFA in front of admin and internal applications

Set up the Access application, policies and token validation

WAF, DDoS protection, rate limiting

General: protection against application-layer attacks, overload and abuse

Useful addition, but no defence against the NGINX2Root flaws

Five next steps

  1. Inventory every nginx instance, including those in containers, as a reverse proxy and as an embedded component, for example in ingress controllers.
  2. Check package versions, enabled features such as HTTP/2, HTTP/3, resolver and mail proxy, and reachability from the internet.
  3. Install the updates, restart nginx and verify that the new version is running and no old worker processes remain active.
  4. Set web hostnames to "Proxied", close the direct path to the origin via Tunnel or a firewall with AOP, and put admin access behind Access.
  5. Test the configuration from the outside, for example by calling the public IP address directly, and keep monitoring the patch level through patch management.

How KAEMI helps

We support you from the initial inventory to day-to-day operations. In an assessment we work with your team to record nginx instances, package versions and reachability, and decide which systems come first. We then plan the connection to Cloudflare, from Tunnel or a firewall with AOP to Access for admin interfaces.

As a Cloudflare partner, we implement the configuration and, if you wish, take over operations as a managed service, including WAF, DDoS protection and rate limiting from our Application Security offering.

Would you like to know how well your web servers and your Cloudflare environment are set up? Get in touch. Together we review your existing configuration and show which steps make the biggest difference.

Sources

Want to protect your web apps and APIs from flaws like this for good?

Related to “NGINX2Root”: KAEMI implements and manages WAF, DDoS protection, bot and API management on the Cloudflare platform — as a managed service.