0%

Nginx2root Fix(Upgrade)

What is NGINX2Root?

nginx2root is a collection of five distinct nginx vulnerabilities and one Linux kernel vulnerability. Each has a proven exploit. The most severe enables unauthenticated remote code execution; chained with a separate Linux kernel vulnerability, it can lead to host root.

Fixed version: 1.31.9

Five nginx findings and one kernel vulnerability
The most severe of the five allows unauthenticated remote code execution on web servers running a common nginx configuration. This remote code execution can be chained with a separate Linux kernel vulnerability to reach host root, remotely and without authentication.

CVE-2026-123007
CVE-2026-123634
CVE-2026-123633
CVE-2026-121810
CVE-2026-113425

Linux kernel · SCTP

Host root · remote, unauthenticated

Who is affected?

The version range below applies to the HTTP/2 remote-code-execution finding, the most severe of the five. Official nginx releases from 1.9.5 through 1.31.8 contain the affected code. Exposure requires HTTP/2 support in the nginx build and an affected listener that accepts HTTP/2 connections.

Each of the other four CVEs is a distinct vulnerability with its own affected range and exploit. Check its individual advisory rather than applying the HTTP/2 finding’s version range to all five.

Distribution packages, appliances, and container images may backport a security fix while retaining an older version string. Confirm patch status from the relevant vendor advisory instead of relying on nginx -v⁠ alone. The host-root stage uses a separate Linux SCTP kernel vulnerability and must be assessed separately.

How do I fix it?

Apply the fixed nginx release or your vendor’s security update as soon as it is available. If you cannot update immediately, disable HTTP/2 on every affected nginx listener until the fix is applied. This mitigates the HTTP/2 finding. For the other CVEs and the Linux kernel finding, see the response guide in our blog post.


How to upgrade Your Nginx to the latest?

Ubuntu

  1. 安装curl以及gpg密钥验证工具

    1
    apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring
  2. 导入Nginx官方的验证密钥文件,用来验证Nginx库的合法性

1
2
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
  1. 验证GPG密钥是否正确
1
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg

运行以上命令后,输出的信息必须包含以下信息:

1
2
3
pub   rsa2048 2011-08-19 [SC] [expires: 2027-05-24]
573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
uid nginx signing key <signing-key@nginx.com>

指纹信息必须为573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62请注意观察.

  1. 将apt 的仓库设置为稳定版release ( 推荐 )
1
2
3
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

如果你想使用mainline版本,可以使用以下命令将仓库设置为mainline

1
2
3
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list
  1. 将nginx源仓库设置为Nginx官方而不走Ubuntu官方的apt仓库下载
1
2
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| sudo tee /etc/apt/preferences.d/99nginx
  1. 更新apt库
1
apt update
  1. 查看当前所有的Nginx软件包
1
apt llist -a nginx

打印出的内容应该为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Listing... Done
nginx/stable,now 1.30.7-1~noble amd64 [installed]
nginx/stable 1.30.6-1~noble amd64
nginx/stable 1.30.5-1~noble amd64
nginx/stable 1.30.4-1~noble amd64
nginx/stable 1.30.3-1~noble amd64
nginx/stable 1.30.2-1~noble amd64
nginx/stable 1.30.1-1~noble amd64
nginx/stable 1.30.0-1~noble amd64
nginx/stable 1.28.3-1~noble amd64
nginx/stable 1.28.2-1~noble amd64
nginx/stable 1.28.1-1~noble amd64
nginx/stable 1.28.0-1~noble amd64
nginx/stable 1.26.3-1~noble amd64
nginx/stable 1.26.2-1~noble amd64
nginx/stable 1.26.1-2~noble amd64
nginx/stable 1.26.1-1~noble amd64
nginx/stable 1.26.0-1~noble amd64
nginx/noble-updates,noble-security 1.24.0-2ubuntu7.20 amd64
nginx/noble 1.24.0-2ubuntu7 amd64

假如打印出的信息还是旧版本,请自行排查或参见【Nginx官方安装指南—Ubuntu】.

  1. 安装最新版的Nginx
1
apt install nginx
  1. 查看更新后的Nginx版本
1
nginx -v

打印信息

1
nginx version: nginx/1.30.7

到此,Ubuntu的Nginx更新完成。


Debian

  1. 安装curl以及gpg密钥验证工具 (Debian库)

    1
    apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring
  2. 导入Nginx官方的验证密钥文件,用来验证Nginx库的合法性

1
2
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
  1. 验证GPG密钥是否正确
1
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg

运行以上命令后,输出的信息必须包含以下信息:

1
2
3
pub   rsa2048 2011-08-19 [SC] [expires: 2027-05-24]
573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
uid nginx signing key <signing-key@nginx.com>

指纹信息必须为573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62请注意观察.(可能会输出多对密钥信息,这是正常的)

  1. 将apt 的仓库设置为稳定版release ( 推荐 )
1
2
3
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

如果你想使用mainline先行版本,可以使用以下命令将仓库设置为mainline

1
2
3
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list
  1. 将nginx源仓库设置为Nginx官方而不走Debian官方的apt仓库下载
1
2
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| sudo tee /etc/apt/preferences.d/99nginx
  1. 更新apt库
1
apt update
  1. 查看当前所有的Nginx软件包
1
apt list -a nginx

打印出的内容应该为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Listing... Done
nginx/stable,now 1.30.7-1~noble amd64 [installed]
nginx/stable 1.30.6-1~noble amd64
nginx/stable 1.30.5-1~noble amd64
nginx/stable 1.30.4-1~noble amd64
nginx/stable 1.30.3-1~noble amd64
nginx/stable 1.30.2-1~noble amd64
nginx/stable 1.30.1-1~noble amd64
nginx/stable 1.30.0-1~noble amd64
nginx/stable 1.28.3-1~noble amd64
nginx/stable 1.28.2-1~noble amd64
nginx/stable 1.28.1-1~noble amd64
nginx/stable 1.28.0-1~noble amd64
nginx/stable 1.26.3-1~noble amd64
nginx/stable 1.26.2-1~noble amd64
nginx/stable 1.26.1-2~noble amd64
nginx/stable 1.26.1-1~noble amd64
nginx/stable 1.26.0-1~noble amd64
nginx/noble-updates,noble-security 1.24.0-2ubuntu7.20 amd64
nginx/noble 1.24.0-2ubuntu7 amd64

假如打印出的信息还是旧版本,请自行排查或参见【Nginx官方安装指南-Debian】

  1. 安装最新版的Nginx
1
apt install nginx
  1. 查看更新后的Nginx版本
1
nginx -v

打印信息

1
nginx version: nginx/1.30.7

到此,Debian的Nginx更新完成。


如您的设备不是Ubuntu也不是Debian,请参见:【Nginx installation instructions】.

其它Linux系统官方直达
- RHEL and derivatives
https://nginx.org/en/linux_packages.html#RHEL

- SLES
https://nginx.org/en/linux_packages.html#SLES

- Alpine
https://nginx.org/en/linux_packages.html#Alpine

- Amazon Linux
https://nginx.org/en/linux_packages.html#Amazon-Linux