Organizing the Two HTTP/2 Vulnerabilities in nginx2root by AWS Configuration

Organizing the Two HTTP/2 Vulnerabilities in nginx2root by AWS Configuration

Explains how the NGINX HTTP/2 vulnerabilities CVE-2026-123007 and CVE-2026-123633 work and their impact on different AWS setups. As a mitigation where patched versions can't be used, Docker confirms http2 off makes curl --http2 fall back to HTTP/1.1.
2026.11.19

This page has been translated by machine translation. View original

Introduction

On 2026-11-18, nginx 1.31.9 and 1.30.7 were released, fixing the HTTP/2 vulnerabilities CVE-2026-123007 and CVE-2026-123633.

https://nginx.org/en/CHANGES

I checked the availability of the fixed versions using Docker and Amazon Linux 2023 containers. I confirmed with the nginx 1.31.9 Docker container that setting http2 off; stops HTTP/2 from being selected.

The five nginx2root vulnerabilities

Xint calls the five RCE vulnerabilities in nginx, combined with a Linux kernel vulnerability, nginx2root. The five have independent attack paths, and the affected configurations differ.

CVE Affected configuration Can disabling HTTP/2 prevent it?
CVE-2026-123007 HTTP/2 enabled Yes
CVE-2026-123634 A configuration that uses a resolver, determines the proxy_pass destination from the request, and uses a mirror with mirror_request_body off (the configuration Xint verified) No
CVE-2026-123633 HTTP/2 enabled, and requests are forwarded to an upstream (backend) Yes
CVE-2026-121810 HTTP/3 enabled, and requests are forwarded to an upstream No
CVE-2026-113425 A mail proxy using proxy on and auth_http No

https://xint.io/blog/nginx2root-remote-code-execution

This article covers two of them, CVE-2026-123007 and CVE-2026-123633, which the Wiz blog rates at 9.2 (Critical) in CVSS v4.0.

How the two vulnerabilities work

CVE-2026-123007

In HTTP/2, the server can only send response data up to the amount the client allows (the send window). When a stream is canceled, the amount of unsent DATA is returned to the send window. If the client had already enlarged the window beforehand, the value after the return exceeds the HTTP/2 maximum of 2^31-1.

At the next WINDOW_UPDATE, nginx calculates "maximum − current window" as an unsigned integer. Because the window exceeds the maximum, the result wraps around to a very large value and passes the maximum check. By repeating WINDOW_UPDATE, the window reaches 2^63 or more, and when it is converted to a signed integer as the send length, it becomes negative, causing an out-of-bounds memory copy. The Wiz blog states that code execution was confirmed on an NGINX (HTTPS, 64-bit) that only serves static files.

The affected versions are 1.9.5 through 1.30.6, and 1.31.0 through 1.31.8. In Rapid7's testing, code execution requires sending about 128 GB of HTTP/2 data, which takes about 17 minutes at 1 Gbit/s and about 2 minutes at 10 Gbit/s.

https://www.rapid7.com/blog/post/ve-cve-2026-123007-critical-nginx-http-2-integer-underflow-leads-to-rce-fixed/

The fix (nginx/nginx commit e27f5fa84fe6) makes the WINDOW_UPDATE check include the amount of data queued in the send queue that has not yet been sent.

-    if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) {
+    if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued) {

CVE-2026-123633

When nginx runs short of free connections, it closes connections in the "reusable connections" list first. An HTTP/2 connection is registered in this list at the point when it has received only part of a HEADERS frame, and it is not removed even after the rest is received and a stream is created.

In this state, when nginx opens a new connection to forward a request to an upstream, ngx_get_connection() tries to close a connection in the list because of the shortage of free connections. If the selected one is the very connection that holds the request being processed, and sending GOAWAY before closing fails, the connection's memory is freed. Because nginx continues processing, a use-after-free occurs. The trigger condition in the nginx.org changelog is a shortage of worker_connections when HTTP/2 is used.

The affected versions are 1.19.7 through 1.30.6, and 1.31.0 through 1.31.8.

The fix (nginx/nginx commit 2df48a501d0f) adds a single line that removes the connection from the "reusable connections" list when a stream is created.

+    ngx_reusable_connection(h2c->connection, 0);

Updating to a fixed version

The first action to take is to update to a fixed version. The fixed versions of NGINX Open Source are 1.31.9 and 1.30.7. After updating, restart nginx. A reload does not replace the running binary.

The Docker nginx image

When I checked the version of the image obtained with docker pull nginx:latest using nginx -v, it was the fixed version 1.31.9.

docker pull nginx:latest
docker run --rm nginx:latest nginx -v

Here is an excerpt of the output of docker pull executed at 2026-11-19 02:12:05 JST.

latest: Pulling from library/nginx
Digest: sha256:228c696e9e835b6087a7061482758db21bfff046cc577402a208acf10465eb66
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest

This is the output of nginx -v executed right after.

nginx version: nginx/1.31.9

Amazon Linux 2023

For the packages distributed by Amazon Linux 2023, the output of nginx -v may not change even when a vulnerability is fixed by backporting. Whether a package is fixed is determined by checking the full package version against ALAS.

When I looked at the dnf information in an Amazon Linux 2023 container at 2026-11-19 02:45 JST, the nginx in the repository was 1.30.6, not the fixed version 1.30.7.

docker run --rm amazonlinux:2023 bash -c "dnf -q info nginx | grep -E '^(Name|Version|Release|Architecture|Repository)'"
Name         : nginx
Version      : 1.30.6
Release      : 1.amzn2023.0.1
Architecture : aarch64
Repository   : amazonlinux

Even with --releasever=latest, it was the same 1.30.6.

In ALAS, as of 2026-11-19 03:21 JST, nginx on Amazon Linux 2023 was Pending Fix for both CVE-2026-123007 and CVE-2026-123633.

https://explore.alas.aws.amazon.com/CVE-2026-123007.html

https://explore.alas.aws.amazon.com/CVE-2026-123633.html

Mitigation by disabling HTTP/2

In environments where a fixed version cannot be obtained, disable HTTP/2. Clients that support HTTP/2 can also continue connecting over HTTP/1.1.

Changing the configuration

Change http2 on; to http2 off;.

server {
    listen 443 ssl;
    http2 off;
    server_name localhost;

    # TLS settings such as ssl_certificate are omitted

    location / {
        root  /usr/share/nginx/html;
        index index.html;
    }
}

If the legacy http2 parameter remains in listen (listen 443 ssl http2;), remove it. The http2 directive was added in 1.25.1, so for versions earlier than that, just remove http2 from listen.

For the steps to apply and verify the configuration, see section 3.3.1 of the Xint blog.

Verifying the behavior

Using Docker's nginx:latest, I compared the http2 on; and http2 off; configurations. To see whether HTTP/2 was selected through TLS ALPN, I included TLS in the test configuration.

Test configuration and startup steps

Save the configuration above as h2-off.conf, and as the omitted TLS settings, add the following two lines under server_name. The h2-on.conf for comparison is the same with only the http2 line set to on.

    ssl_certificate     /etc/nginx/certs/server.crt;
    ssl_certificate_key /etc/nginx/certs/server.key;

Create a self-signed certificate.

mkdir -p /tmp/h2certs
openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj /CN=localhost -addext subjectAltName=DNS:localhost -keyout /tmp/h2certs/server.key -out /tmp/h2certs/server.crt

Start the container in the directory where the configuration files are placed, and mount the configuration file at /etc/nginx/conf.d/default.conf. The following command is for h2-off.conf.

docker run -d --name h2test -p 127.0.0.1:8443:443 -v "$PWD"/h2-off.conf:/etc/nginx/conf.d/default.conf:ro -v /tmp/h2certs:/etc/nginx/certs:ro nginx:latest

To verify http2 on, start with h2-on.conf, and when finished, delete the container with docker rm -f h2test and start again with h2-off.conf.

For each of http2 on and http2 off, I ran the following commands.

docker exec h2test nginx -T 2>&1 | grep -E "http2|listen"
curl --http2 -k -sS -o /dev/null -w 'http_version=%{http_version} http_code=%{http_code}\n' https://localhost:8443/
openssl s_client -connect localhost:8443 -servername localhost -alpn h2 </dev/null 2>&1 | grep -E "ALPN"
Setting nginx -T curl openssl s_client
http2 on listen 443 ssl; http2 on; http_version=2 http_code=200 ALPN protocol: h2
http2 off listen 443 ssl; http2 off; http_version=1.1 http_code=200 No ALPN negotiated

Whether HTTP/2 is no longer selected can be determined from the ALPN result.

Notes when applying

  • Services that require HTTP/2, such as gRPC, will no longer work.
  • Set http2 off; in all server blocks that share the same address and port.
  • A reload or restart is required to apply the configuration.

Decisions by AWS configuration

The protocol that reaches NGINX in each configuration

Configuration Protocol to NGINX Decision
CloudFront (cache behavior without gRPC enabled) HTTP/1.1 HTTP/2 does not reach NGINX through this path
CloudFront (cache behavior with gRPC enabled) gRPC (over HTTP/2) gRPC is a protocol over HTTP/2, so update to a fixed version
ALB (target group is HTTP1, the default) HTTP/1.1 HTTP/2 does not reach NGINX through this path
ALB (target group is HTTP2) HTTP/2 NGINX's HTTP/2 processing is used. Update to a fixed version
ALB (target group is GRPC) gRPC (over HTTP/2) Likewise, update. gRPC requires HTTP/2, so it cannot be used with http2 off;
TCP listeners of NLB and CLB Relayed as TCP It reaches NGINX still encrypted, so HTTP/2 cannot be stopped at an NLB or CLB
EC2 (reachable directly from the internet to NGINX via a public IP and security group) The protocol the client chooses (including HTTP/2) NGINX's HTTP/2 processing is used. Update to a fixed version

The protocol version of a target group can be checked in ProtocolVersion in the output of aws elbv2 describe-target-groups. The value is one of GRPC, HTTP1, or HTTP2.

Paths that reach NGINX directly

Even in the CloudFront and ALB configurations that the table says "HTTP/2 does not reach NGINX", if the instance running NGINX has a public IP and the security group allows traffic from the internet, attack requests can reach NGINX directly. If this applies, we recommend reviewing the security group.

Summary

CVE-2026-123007 and CVE-2026-123633 both originate from defects in NGINX's HTTP/2 processing, and 1.31.9 and 1.30.7 have been released as fixed versions.

On AWS, please check whether there is a path through which HTTP/2 reaches NGINX. If you may be affected and cannot obtain a fixed RPM or similar, consider the mitigation of disabling HTTP/2 with http2 off;.

Share this article

AWSのお困り事はクラスメソッドへ

Related articles