nginx HTTP/2 flaw: patch, then restart

On 18 November nginx released 1.31.9 and 1.30.7, which fix multiple security bugs, including the five nginx flaws known as nginx2root. The worst of them is CVE-2026-123007, a flaw in the HTTP/2 code that has been there since 1.9.5, released in 2015. If your nginx serves HTTP/2, researchers at Wiz and Xint have shown that an unauthenticated attacker can run commands with the privileges of an nginx worker process. It scores 9.2 on CVSS 4.0.

CERT-EU reported on 18 November that no exploitation in the wild had been reported at that point. The public exploit also needs a specific setup, but I would still patch promptly. After updating, restart nginx: a reload does not replace the running executable.

The short version

  1. Find out which of your servers run nginx with HTTP/2 enabled (commands below).
  2. Update to 1.30.7 or 1.31.9, or to your distribution's fixed package.
  3. Restart nginx. A reload is not enough.
  4. If there is no fixed package yet (for example, Debian bookworm and trixie as of 19 November), turn HTTP/2 off for now. That closes two of the five bugs.
  5. If you don't use SCTP, block the module on the host (see "What we know about the attack").

Are you affected?

CVE-2026-123007 affects nginx starting with 1.9.5 when HTTP/2 is enabled. The fixes are 1.30.7 on the stable branch and 1.31.9 on mainline; 1.30.7 is already fixed despite having a lower version number than 1.31.8. Builds without the HTTP/2 module and releases older than 1.9.5 are not affected. Start by checking the build options and the full configuration:

bash
# does the build include the HTTP/2 module?
nginx -V 2>&1 | grep -o -- '--with-http_v2_module'

# print the full configuration, including included files
sudo nginx -T

Look for http2 on; and the legacy http2 parameter on listen directives. Check the http block too, because server blocks can inherit HTTP/2 settings from it. A failed nginx -T does not mean HTTP/2 is disabled. With multiple nginx instances, check the correct executable and configuration. This command reads files on disk; changes that have not been loaded may differ from the running configuration.

You can also check from outside:

bash
openssl s_client -connect example.com:443 -servername example.com -alpn h2 </dev/null 2>&1 | grep -E 'ALPN protocol:|No ALPN negotiated'

ALPN protocol: h2 means the server accepts HTTP/2. If a CDN or load balancer sits in front of nginx, point the command at nginx's own address, or you are checking the CDN. Keep the site's domain in -servername. One endpoint does not cover every virtual host and port, and a failed TLS connection does not prove HTTP/2 is disabled.

The version number won't always give you an answer. Distributions often backport a fix while changing only the package revision. nginx -v alone therefore cannot establish whether the fix is installed. Check your distribution's security page for the package version that contains the fix.

What we know about the attack

F5's description says the HTTP/2 flow-control window can exceed its allowed limit, which leads to a heap buffer overflow. That usually ends in a worker crash, and code execution is possible where ASLR is off or the attacker can bypass it. Wiz says the bug is exploitable with a default HTTP/2 setup, even on an nginx that only serves static files, so no proxying or unusual configuration is needed. They ran code on official 1.31.7 and 1.31.8 builds on 64-bit systems over TLS, bypassing ASLR. Don't count on ASLR as protection.

The commands run with the worker's privileges, and getting root takes a second bug. Xint used a separate, still unpatched Linux kernel flaw in the SCTP protocol. Its 18 November disclosure gives no CVE identifier, and the code has been in the kernel since Linux 4.15 in 2018. With it they got a root shell from an nginx worker, including one running in Docker, on the host. Containers share the host's kernel, so a successful kernel exploit can compromise the other containers too. Whether this path is reachable depends on the kernel, SCTP availability and container restrictions. If you don't use SCTP, Xint recommends blocking the module:

bash
echo 'install sctp /bin/false' | sudo tee /etc/modprobe.d/disable-sctp.conf

That only stops loading through modprobe. It does not unload a module that is already loaded (lsmod | grep sctp), and it does nothing if SCTP is compiled into the kernel. This is separate from the TCP flaw discussed previously: fixing that CVE does not fix the SCTP bug. I wrote about kernel updates in the CVE-2026-98432 article.

Rapid7's Stephen Fewer has published an exploit on GitHub. Rapid7's own analysis says its method depends on a specific x86-64 glibc memory-copy implementation, needs roughly 128 GB of HTTP/2 traffic and bypasses ASLR. I wouldn't rely on the traffic volume or glibc requirement for protection: another method could have different requirements. Wiz has not published its exploits, and Xint is withholding some reproduction details. All three teams report successful code execution in lab tests.

The other four bugs

The release fixes four more from the nginx2root set:

  • CVE-2026-123633: an HTTP/2 use-after-free, when nginx passes requests to a backend and a worker runs low on connections (worker_connections).
  • CVE-2026-123634: a use-after-free when a proxied backend's name contains variables and an SSI or mirror subrequest looks up the same name.
  • CVE-2026-121810: a use-after-free when HTTP/3 is in use and a worker runs out of free connections.
  • CVE-2026-113425: a use-after-free when the mail proxy uses proxy on and auth_http.

nginx's own advisory list shows more fixes in the same release, for example an infinite loop when reading a request body over TLS 1.3 (CVE-2026-118899). The TLS 1.3 flaw is another reason disabling HTTP/2 does not make the server safe. Releases 1.30.7 and 1.31.9 fix the flaws listed here.

How to update

The fixed official releases are 1.30.7 (stable) and 1.31.9 (mainline). For NGINX Plus they are 37.3.0.1 and 37.0.8.1. Rapid7's table lists no fixed release for CVE-2026-123007 on R34–R36; move those installations to a fixed 37.x release.

The Hacker News reported that Ubuntu and Debian had no fixed packages yet. On 19 November Ubuntu's tracker lists fixed packages (for example 1.24.0-2ubuntu7.20 for 24.04 and 1.18.0-6ubuntu14.23 for 22.04). Debian's tracker marks only unstable (sid, 1.30.6-4) as fixed, while bookworm and trixie are still vulnerable. The fixes for affected Ubuntu releases from 20.04 and earlier require Ubuntu Pro, with the Legacy Support add-on for 16.04. Always confirm your distribution's status on its security page. These tracker entries cover CVE-2026-123007; check the other CVEs separately.

bash
sudo apt update
sudo apt install --only-upgrade nginx
dpkg-query -W -f='${binary:Package} ${Version}\n' 'nginx*'
sudo nginx -t && sudo systemctl restart nginx

Compare the full installed package versions with your distribution's advisory. Packaging varies between releases: confirm which package provides the nginx executable you use. A restart interrupts active connections, so expect a brief outage. Check service status and site availability afterwards. Xint says nginx's supported live binary upgrade also works, but I'd use a plain restart, because it is easier to confirm afterwards that the new binary is running.

With Docker, rebuilding or pulling the image isn't enough. Recreate the container too, because the old one keeps running the old nginx. Check the installed version inside the replacement container (replace nginx-container with its name):

bash
docker exec nginx-container nginx -v

nginx -v starts a new process to print the version; it does not prove the serving process was replaced. With distribution packages, the full package version still matters.

On shared or managed hosting, nginx belongs to the provider. Ask them directly whether CVE-2026-123007 is fixed on the server your site runs on.

If you can't update yet

Turning HTTP/2 off stops CVE-2026-123007 and CVE-2026-123633, but not the other three. Wiz and Xint both describe it as a temporary measure. On nginx 1.25.1 or later, switch it off in the server block:

nginx
server {
    listen 443 ssl;
    http2 off;
    # ...
}

If your listen line carries the http2 parameter, remove it. On versions from 1.9.5 to 1.25.0 that is the only way: change listen 443 ssl http2; to listen 443 ssl;. Check every affected server block, including those sharing an address and port. Apply the change with sudo nginx -t && sudo systemctl reload nginx. Old workers may keep serving existing connections with the previous configuration. Confirm they have exited; restart nginx if they have not. Repeat the HTTP/2 check and confirm the site still works over HTTPS.

Clients that support HTTP/1.1 fall back to it, but anything that depends on HTTP/2, gRPC for example, stops working, so try it on a test machine first. Turn HTTP/2 back on after you update.

Xint also describes temporary restrictions for the other three: removing request-time DNS resolution, disabling HTTP/3 and restricting access to the mail proxy. These need to fit your configuration and do not replace installing the fixes.

What to check afterwards

Wiz suggests looking for unexpected nginx worker crashes and for commands launched by nginx. Both are general warning signs, and neither proves an attack.

bash
sudo grep -Ei 'worker process.*exited|signal 11|segfault' /var/log/nginx/error.log
ps -eo pid,ppid,user,args --forest

Find the nginx workers in the process tree and check for programs they started. This is only a snapshot and can miss short-lived commands. Log paths depend on your configuration; inspect older and compressed logs separately. Xint notes that the HTTP/2 control frames used by the attack do not appear as requests in the access log. Empty results do not rule out a compromise.

Investigate any unexpected program started by a worker, or repeated worker crashes. If you suspect a break-in, preserve the logs and other evidence first. A confirmed break-in means more work than patching: you may need to rebuild the server from a trusted source and replace affected keys and passwords.

Need a hand?

I build and run PHP and Laravel applications. If you need help checking your servers, planning the nginx and kernel updates, or investigating a possible break-in, get in touch.


Sources

All articles →