跪拜 Guibai
← All articles
Nginx · Ops

Nginx 1.31.9 Closes Five CVEs, Including One That Chains to Host Root

By tonydf ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A server that fronts a huge share of the web now carries five CVEs, one of which yields unauthenticated RCE and another that chains to host root. Operators who can't upgrade need to know that toggling HTTP/2 off only covers two of the five, so a partial patch is still a real exposure.

Summary

Xint's nginx2root collection lists five critical Nginx CVEs. The most severe allows an unauthenticated attacker to run commands on any Nginx server with HTTP/2 enabled, and one of the five combines with a separate Linux kernel vulnerability to escalate to root on the host. Nginx's fix ships in 1.31.9 (mainline) and 1.30.7 (stable), but the upgrade is not a simple package refresh for everyone.

Disabling HTTP/2 is only a partial mitigation. It blocks the two CVEs tied to HTTP/2, but the resolver use-after-free, HTTP/3 UAF, and mail proxy UAF remain active when those features are enabled. Operators running resolver, HTTP/3, or mail proxy need to patch sooner rather than later.

The post walks through an in-place binary replacement: download the tarball, back up the existing binary and its `nginx -V` output, compile with identical configure arguments, then replace `/usr/local/nginx/sbin/nginx` and restart with `stop` (not `reload`). Verification and rollback steps are included. The method assumes a simple install; third-party modules and symlinks require extra care.

Takeaways
— Xint's nginx2root research documents five critical Nginx CVEs; the most severe allows unauthenticated command execution on servers with HTTP/2 enabled.
— One of the five CVEs chains with a Linux kernel vulnerability to gain root on the host machine.
— Nginx 1.31.9 (mainline) and 1.30.7 (stable) are the patched releases; the official update log is at nginx.org.
— Disabling HTTP/2 only blocks CVE-2026-123007 and CVE-2026-123633; the resolver UAF, HTTP/3 UAF, and mail proxy UAF can still be triggered.
— The upgrade guide replaces only the binary, avoiding `make install` so config, HTML, and logs stay untouched.
— Preserve the output of `nginx -V` before upgrading; the configure command must match the original build flags, and blindly copying an OpenSSL flag can change binary behavior.
— Restart with `nginx -s stop` then start again; `reload` is not sufficient after a binary swap.
— Rollback is possible by restoring the backed-up binary and restarting.
Conclusions

The article's warning that disabling HTTP/2 doesn't cover all five CVEs is a reminder that feature-specific mitigations only work when you know exactly which modules are enabled in your deployment.

The binary-replacement upgrade method is a reasonable pattern for simple installations, but the author's own caution about third-party modules and symlinks shows that a production-grade upgrade still requires a full dependency audit.

The advice to save `nginx -V` output and match configure arguments exactly calls out a common failure mode: many operators compile with extra flags that don't match the original build, leading to subtle behavioral changes.

Concepts & terms
Use-after-free (UAF)
A memory safety bug where a program continues to use a pointer after the memory it references has been freed, often leading to crashes or remote code execution.
Mainline vs. stable branch
Nginx's two release lines: mainline gets new features and is sometimes less conservative, while stable is the recommended branch for production. Both receive security fixes.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗