Contents

nginx2root Chains a 2015 nginx HTTP/2 Bug and a Linux Kernel Zero-Day to Root, Even From Docker

 

Ethical Hacking Complete Course Zero to Expert

Hack like black hat hackers. Penetration testing, Kali Linux, WiFi and web hacking, and the hacker mindset behind it.

→ Take the full course
 
Contents

9.7 million web addresses announce an nginx version with a flaw that lets an attacker run code without logging in. HTTP/2 switched on is enough. The flaw went in with nginx’s first HTTP/2 code, in 2015.

nginx is the program on a server that answers when a browser asks for a web page. It sends the page itself, or it receives the request first and passes it on to other software behind it. According to the daily count of W3Techs, nginx runs 29.7 percent of the websites whose web server is known.

# TL;DR

On November 18, the nginx project released versions 1.31.9 and 1.30.7 with fixes for ten vulnerabilities. Five of them are memory bugs that the security company Xint found and named nginx2root. The most serious one is CVE-2026-123007, the public ID for a flaw in the part of nginx that speaks HTTP/2. F5, the company that owns nginx, gives it 9.2 out of 10 on CVSS 4.0, the scale used to score how serious a flaw is.

According to the researchers, an attacker who has no account on the server can make nginx execute commands of their choosing, as long as HTTP/2 is switched on. They showed it on a cloud server, attacking it from the outside over its public IP address. Then they used a second flaw, in the Linux kernel, and became root on the machine underneath. In that test, nginx ran inside a Docker container.

The scanning company Censys keeps a live count of nginx installations that are open to this flaw. On November 21, its tracker showed 9,776,434 services on an affected version with HTTP/2 switched on. It counts a service as an IP address or a hostname with a port, so one server can show up more than once. Another 114,417,159 nginx services hide their version number, and the company leaves those out. The tracker itself says the true number is higher.

About 3.7 million of the services in that count are distribution builds that name themselves in the server header, such as Ubuntu’s. Ubuntu fixes nginx without changing the version number, so many of those may already have the fix. The scanning company calls its count an estimate, not a check of each server.

The researchers did their own count on November 10, with Shodan, a search engine for devices on the internet. That search found 56.7 million hosts running nginx. 11.94 million of those showed a version number, and 98.9 percent of them fell in the affected range.

The only setting the flaw needs is HTTP/2, the newer way for a browser and a server to talk. With the older HTTP/1.1, a browser sends one request over a connection and waits for the answer before it sends the next one. HTTP/2 lets it send many requests over the same connection at once, each in its own numbered stream. In nginx, switching it on takes one word at the end of the line where a site listens for visitors: listen 443 ssl http2;. From version 1.25.1 on, it can also be a line of its own, http2 on;.

nginx got HTTP/2 in version 1.9.5, released on September 22, 2015. The changelog for that release opens with the new module, ngx_http_v2_module, and thanks Dropbox and Automattic for sponsoring the work. The researchers found the vulnerable code in each official release from 1.9.5 through 1.31.8, and in the development branch as it stood on November 10.

To keep one side from sending more than the other can handle, HTTP/2 keeps a counter on both ends. It says how much data the other side may still send, and it is called the flow control window. When the receiver has room for more, it sends a short message called WINDOW_UPDATE, and the window grows by the number in that message. The HTTP/2 standard sets a ceiling: the window may never go above 2,147,483,647 bytes, the largest number that fits in 31 bits.

The researchers found that a client can push the window for a connection past that ceiling. nginx has a check that should stop it. That check compares numbers that can never be negative, called unsigned numbers, and it does not see the overflow. From then on, nginx calculates with a window size that is wrong. It writes data outside the piece of memory it set aside, and it reads from outside it too. That memory is the heap, the pool the program hands out to itself while it runs.

The messages the attack uses to trigger the flaw are WINDOW_UPDATE and RST_STREAM, the second one telling the server to drop a stream. nginx does not log them as requests, and over HTTPS they are encrypted on their way in. An attack can leave little in the access log, the file where nginx writes down each visit.

Each time a program starts, its code and data land at a random place in memory, so an attacker does not know where to aim. That protection is called ASLR. F5 writes that an attacker can run code through this flaw when ASLR is off, or when they get around it. The researchers get around it by first using the same flaw to leak 64 bytes that hold addresses of the nginx program and of the heap.

The attacker’s commands then run as the nginx worker that handled the request. nginx starts one main process, and that process starts a few worker processes that deal with the visitors. A worker usually runs under a separate user with limited rights on the system. To get past those limits, the researchers used the second flaw.

That one sits in the Linux kernel, the core of the operating system, in its code for SCTP, a network protocol that runs next to the better known TCP and UDP. A connection in SCTP is called an association, and a program can hand an association over to another socket, the endpoint a program uses to send and receive. The researchers found that this handover can happen while a send on that association is still waiting. When the waiting send finishes, it frees the association, while the other socket still uses it. Depending on what that socket does next, the kernel uses memory that was already given back, or gives the same memory back twice.

That bug gives the researchers two things. The first is a leak of kernel memory that defeats KASLR, the same random placement for the kernel itself. The second is a way to make the kernel call a function the attacker picks. In their tests, an attacker already running code as an nginx worker could reliably become root. The kernel flaw went into Linux in version 4.15, in 2018. When the researchers published, it had no CVE and no patch, and they are holding back most of the details until a fix is out.

On many Linux distributions, they write, the SCTP module is installed by default, and the kernel loads it on its own the first time a program opens an SCTP socket. Code running in the nginx worker can open one and bring the vulnerable code into the kernel. On a given host, it depends on the kernel, the modules on it and the limits set on the container, they add. Red Hat Enterprise Linux (RHEL) 8 and later is an exception: there, SCTP comes in a separate package, kernel-modules-extra, and the company writes that the module is blacklisted by default.

This is why Docker did not stop it. A container has its own files and its own processes, but it runs on the kernel of the host, the same kernel the other containers on that machine use. Root in that kernel means control over the host and over the other containers on it. The researchers do not say which Docker settings the test container ran with.

They tested the nginx flaw on AWS, Google Cloud and Azure: from inside the server, from the private network next to it, and over the public IP address. They list success in each of those nine tests, and write that the attack also works with normal traffic on the server at the same time.

It is the second SCTP flaw this year that leads out of a container. In August, Tencent’s Zhuque Lab published CVE-2026-64564, a different bug in the kernel’s SCTP code, and reached root on the host in six of eight attempts from inside a container. That test kept the default seccomp profile switched on, the filter that blocks risky system calls inside a container, and gave the container none of the extra rights CAP_NET_ADMIN and CAP_SYS_ADMIN. Linux has fixed that one.

The nginx2root researchers were not the only team on this bug. They reported their five bugs to F5 on October 16. One of them had found the flow control flaw first, and a few days later an automated scan by the same company found the other four without a person guiding it. F5’s advisory thanks four teams for the flow control flaw, and next to one of them, Ikotas Labs, it names GPT-6 Astra, an AI model.

Wiz Research lists five teams that found the HTTP/2 flaws separately, its own among them. It found its two with Atlas, the system behind its AI code scanning. When it reported the other HTTP/2 flaw, CVE-2026-123633, on October 21, F5 told it another team had already reported the same bug. It reported the flow control flaw on November 16, two days before the release, and F5 confirmed the next day that it was the same one.

The fix carries an earlier date than the warning. In nginx’s public repository on GitHub, the commit that repairs the flaw is titled HTTP/2: account for queued frames when validating WINDOW_UPDATE. Its date is November 11, 12:16 UTC, a week before the release and the advisory. The commit does not show the moment it became visible there. On that same November 11, Rapid7, where Stephen Fewer had found the same flaw, made its first contact with F5 about it and sent its report the next day.

He also published an exploit for the nginx flaw: code that runs commands on a vulnerable nginx 1.31.8 in a Docker image for 64-bit Linux, with HTTP/2 and HTTPS switched on. His write-up puts the traffic it needs at about 128 GB of HTTP/2 data: two minutes on a 10 Gbit/s connection, seventeen minutes on 1 Gbit/s. On a line slower than about 300 Mbit/s it does not finish, because nginx closes a connection after one hour by default. The nginx2root researchers kept the last steps of their own exploit out of their write-up, and write that their approach does not depend on exact response sizes.

Seven days before the nginx release, on November 11, the Apache project published a critical flaw in its HTTP/2 module that can also lead to remote code execution. The same daily count puts that web server at 20.4 percent of the websites with a known web server, and nginx at 29.7. Within one week, the two web servers behind about half of those websites both got an HTTP/2 flaw that can let an attacker run code.

nginx is also built into other F5 products. The advisory lists the NGINX Ingress Controller, which brings outside traffic into a Kubernetes cluster, with fixes in version 5.8.0 and in its long-term support release 2026-lts-r11. For its 4.x and 3.x lines, for NGINX App Protect WAF, NGINX App Protect DoS, NGINX Gateway Fabric 1.x and NGINX Plus R34 to R36, it lists no fixed version. Under mitigation, it says none.

So far, no attacks using these flaws have been reported. The scanning company knew of none on November 18, and Cloudflare had seen no reports on November 19, though it warns that fake exploits for nginx2root are going around on GitHub. CISA, the US cybersecurity agency, had not added any of the five to its catalog of exploited flaws by then.

The fix is nginx 1.31.9 or 1.30.7, and NGINX Plus 37.3.0.1 or 37.0.8.1. Older nginx branches get no fix from the project, so a server on one of them has to move up.

Since November 18, the tracker has seen 11,067,818 services on an affected version with HTTP/2 switched on. By November 21, 1,236,068 of them had updated or switched HTTP/2 off, 183,355 of those in the last 24 hours. A fixed service only shows up as fixed after its next scan, so the count runs a few days behind.

The most common version on the tracker is 1.24.0, the nginx that comes with Ubuntu 24.04. Linux distributions put the fix into their own packages and keep the old number, which is called backporting. Debian and RHEL do the same, but their servers do not name themselves in the header, so a fixed one still counts as exposed on the tracker.

Where the distributions stand:

  • → Ubuntu published its notice on November 19, with fixes from 16.04 through 26.10. Versions 20.04 and older get theirs through Ubuntu Pro
  • → The fixed Ubuntu package is 1.18.0-6ubuntu14.23 on 22.04, 1.24.0-2ubuntu7.20 on 24.04 and 1.28.3-2ubuntu1.13 on 26.04
  • → Debian fixed version 13 (trixie) with 1.26.3-3+deb13u11 and version 12 (bookworm) with 1.22.1-9+deb12u11

A configuration reload keeps the old program running, so nginx has to be restarted after the update.

These commands show which version runs, if nginx has HTTP/2 built in, and where the configuration switches it on. On Debian or Ubuntu, the last one shows the package version to compare with the list above:

1
2
3
4
nginx -v
nginx -V 2>&1 | grep -o with-http_v2_module
grep -rn "http2" /etc/nginx/
dpkg -l nginx | grep ^ii

A server that cannot update yet can switch HTTP/2 off, which blocks this flaw and the other HTTP/2 flaw. From version 1.25.1 on, that means http2 off; in each server block and no http2 on the listen lines. On older versions, take http2 out of the listen line. Then test the configuration and restart:

1
2
3
4
listen 443 ssl;
http2 off;

sudo nginx -t && sudo systemctl restart nginx

For the kernel flaw, the researchers advise stopping the SCTP module from loading, which also takes SCTP away from programs that use it. That does not unload a module that is already loaded, and it does nothing on a kernel with SCTP built in. The first command shows if it is loaded:

1
2
lsmod | grep sctp
echo "install sctp /bin/false" | sudo tee /etc/modprobe.d/disable-sctp.conf

The update fixes the flaw, but it does not show if an attacker already used it. Because the attack can leave so little in the access log, the researchers describe other places to look.

The first is the connection itself. During an attack, one connection from the same address stays open for minutes, and the number of bytes nginx receives on it keeps climbing fast while nginx sends little back. That is the flood of WINDOW_UPDATE messages. Run this command twice, a short time apart, and compare bytes_received and bytes_sent:

1
sudo ss -tinp state established '( sport = :443 )'

The second is a log that also records which connection each request came over and how many requests that connection carried. It goes in the http block of the nginx configuration. When the bytes received keep growing while the logged requests stay small, the client is sending data that never shows up as a request:

1
2
3
4
5
6
7
8
9
log_format h2_hunt '$time_iso8601 src=$remote_addr conn=$connection '
                   'requests=$connection_requests proto=$server_protocol '
                   'status=$status request_length=$request_length '
                   'bytes_sent=$bytes_sent request_time=$request_time';

access_log /var/log/nginx/h2-hunt.log h2_hunt;

sudo nginx -t && sudo nginx -s reload
sudo grep 'proto=HTTP/2.0' /var/log/nginx/h2-hunt.log | tail -n 200

The third is a program started by the worker. A normal nginx worker has no reason to run other programs, and the researchers’ exploit starts a shell through execve(), the system call that starts a program. According to the researchers, a program started by an nginx worker is the clearest sign of a successful attack. The first command shows the user ID the workers run under. On systems with auditd, the Linux audit system, the rule after it logs each program started under that ID, with NGINX_UID replaced by that number:

1
2
3
ps -eo uid,user,pid,ppid,args | grep '[n]ginx: worker process'
sudo auditctl -a always,exit -F arch=b64 -S execve,execveat -F euid=NGINX_UID -k nginx_worker_exec
sudo ausearch -k nginx_worker_exec -ts recent -i

With -ts recent, ausearch only looks back ten minutes, and -ts today covers the day. The rule only records what happens after it is added, so an empty result does not rule out an earlier break-in. It also catches other processes under the same user ID, so the process and parent process IDs tell which entries came from nginx.

The fourth is a worker that crashed. A failed attempt can bring a worker down, and so can problems that have nothing to do with an attack:

1
2
sudo grep -Ei 'worker process.*exited|signal 11|segfault' /var/log/nginx/error.log
sudo coredumpctl list nginx

On their own, high incoming traffic, many connections from one address, a gap between bytes received and logged requests, and crashed workers can each have a normal cause. When several of them show up together and there is no explanation, the researchers advise blocking the source and investigating.

Run curl -sI --http2 against a server you own and check whether it answers over HTTP/2 and which nginx version it announces.

My Ethical Hacking Complete Course Zero to Expert takes you there step by step: reconnaissance, scanning, exploitation and traffic analysis, hands-on, from your first day with no Linux or hacking background.

→ Join my complete ethical hacking course

Hacking is not a hobby but a way of life.

Sources:

Xint: NGINX2Root | nginx security advisories | F5 K000163926 | Censys nginx2root tracker

 
NEWSLETTER

Stay updated

Get the latest posts in your inbox every week. Ethical hacking, security news, tutorials, and everything that catches my attention. If that sounds useful, drop your email below.

By Bulls Eye

Jolanda de koff • email • donate

My name is Jolanda de Koff and on the internet, I'm also known as Bulls Eye. Ethical Hacker, Penetration tester, Researcher, Programmer, Self Learner, and forever n00b. Not necessarily in that order. Like to make my own hacking tools and I sometimes share them with you. "You can create art & beauty with a computer and Hacking is not a hobby but a way of life ...

I ♥ open-source and Linux