Skip to content
RCE Write-up Advanced

NGINX2Root: Remote Code Execution Vulnerabilities in Nginx

Five independent unauthenticated remote code execution flaws were found in nginx, the most impactful affecting any server with HTTP/2 enabled and letting an attacker run commands as the nginx worker process. A separate Linux kernel SCTP flaw can then be chained to escalate to root on the host, including escaping a Docker container.

xint.io

Published on xint.io

Introduction1. Executive SummaryWhat an attacker can doAffected versionsWhat to doHow we found themnginx2root at a glance2.

The author, on xint.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely memory-safety flaws in how nginx parses HTTP/2, HTTP/3 and mail proxy traffic, plus a separate kernel SCTP bug, though the text does not state the precise coding mistake.

Impact

An unauthenticated attacker could execute arbitrary commands with nginx worker privileges, and by chaining the kernel flaw could gain root on the host and escape a Docker container; disabling HTTP/2 blocks only two of the five nginx flaws.

What the attacker needed

Nginx 1.9.5 to 1.31.8; HTTP/2 enabled on the listener; network reachability to the server

The fix

It should be fixed by updating to nginx 1.31.9 once available, with temporary mitigations such as disabling HTTP/2, HTTP/3, request-time DNS lookups and external mail proxy access.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

nginx is a very common piece of software that many websites use to receive visitors' requests. A remote code execution bug means an outsider can make that software run commands of their choosing, without logging in first. Here the commands run as the limited account nginx uses, and a second bug in the operating system's kernel can then be used to take full control of the machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.