DEV Community

StarkMan
StarkMan

Posted on

Temporary HTTP/2 Mitigation for NGINX Before Patching

Temporary HTTP/2 Mitigation for NGINX Before Patching

Disabling HTTP/2 can interrupt CVE-2026-123007 exploitation without requiring an immediate NGINX update. It is a temporary control, and it must be applied to the actual listeners rather than relying on a global setting. Inherited or included server blocks may not match that setting. It also does not address the other NGINX2Root vulnerabilities.

The best outcome remains a fixed build. When change control or vendor availability delays patching, an explicit HTTP/2 shutdown with verification can reduce exposure while the update is prepared.

Vulnerability overview

CVE-2026-123007 is an HTTP/2 flow-control integer overflow in NGINX. Upstream 1.9.5 through 1.31.8 is affected. NGINX Open Source 1.30.7 and 1.31.9 contain the upstream fix.

Ubuntu records CVSS 4.0 score 9.2 and CVSS 3.1 score 8.1. CERT-EU reports demonstrated unauthenticated code execution. CIRCL documents a public proof of concept that works with ASLR enabled, so turning off HTTP/2 is more directly tied to this CVE than relying on memory-layout hardening.

Mechanism and exploitation conditions

The vulnerability uses queued response DATA and canceled streams to restore HTTP/2 send-window credit twice. The connection window exceeds its 31-bit maximum, and later capacity checks wrap because the value is unsigned.

The corrupted window can become a small negative signed offset and then a very large copy length. NGINX performs an out-of-bounds heap read and write. The published research uses address disclosure and heap corruption to redirect a cleanup callback.

The attack requires a reachable listener with HTTP/2 enabled on an affected build. If HTTP/2 is not compiled into the binary or is disabled on every relevant listener, this specific remote path is not available. H2C and non-TLS listeners also need review when deployed.

Impact

Successful exploitation runs commands as the NGINX worker. The worker may access TLS secrets, upstream credentials, mounted files, local sockets, and internal networks. It does not automatically gain root, but it can provide a strong foothold.

The NGINX2Root host-escalation chain depends on a separate Linux SCTP kernel issue. Disabling HTTP/2 does not address that kernel bug, and the broader set of NGINX vulnerabilities may still be reachable through other configurations.

Affected products and scope

Affected upstream versions are NGINX Open Source 1.9.5 through 1.31.8. Fixed branches are 1.30.7 and 1.31.9. NGINX Plus 37.0.0 through 37.0.7.1 and 37.1.0 through 37.2.0.1 are affected; R34, R35, and R36 also require review. Fixed Plus builds are 37.0.8.1 and 37.3.0.1 according to F5.

The temporary control should cover every exposed virtual server, IPv4 and IPv6 address, alternate TLS port, and origin listener. A CDN may negotiate HTTP/2 with clients while forwarding HTTP/1.1 to NGINX. Test the backend itself because the front-end result can hide origin exposure.

Exposure context

ZoomEye app="NGINX" returned 316,066,088 product matches. The exact CVE filter returned zero.

The count is a product-fingerprint Exposure, not proof of HTTP/2 use or vulnerable packages. It can identify a review population but cannot verify that a mitigation changed the listener protocol.

Remediation and mitigations

For NGINX 1.25.1 and later, remove the http2 parameter from the listen directive and set http2 off; in each affected server context. For older releases, remove http2 from the relevant listen directives. Check included files and inherited server blocks.

Run nginx -t before applying the change. After reload or restart, use a client and openssl s_client -alpn h2 from the relevant network to confirm that the endpoint no longer negotiates h2. Repeat the test for every listener and origin.

Coordinate before disabling HTTP/2 because some gRPC and application clients require it. Document an exception, owner, and expiration for any listener that cannot use the mitigation. Continue toward a patched build instead of treating the workaround as a permanent configuration.

Patch to 1.30.7, 1.31.9, a fixed NGINX Plus build, or a vendor-confirmed backport. Restart to replace old workers. Review the other four NGINX2Root CVEs and apply their corresponding fixes or mitigations.

References

Top comments (0)