Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/nginx-http2-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: nginx (CVE-2026-123007, CVE-2026-123633, CVE-2026-123634) bash detector

on:
push:
paths:
- "CVE-2026-123633.CVE-2026-123007/linux/**"
- ".github/workflows/nginx-http2-linux.yml"
pull_request:
paths:
- "CVE-2026-123633.CVE-2026-123007/linux/**"
- ".github/workflows/nginx-http2-linux.yml"
workflow_dispatch:

permissions:
contents: read

env:
DIR: CVE-2026-123633.CVE-2026-123007/linux
# Pinned by digest. nginx:1.30.6 / 1.30.6-alpine are the last releases
# before the fix; the distro images get nginx from their own repositories.
IMG_ORG: nginx@sha256:42c68eab6f7e22611786a9fe1d1c019e275c50185bd54b8f75dc2b9184322703
IMG_ALPINE: nginx@sha256:901e593c95dc85f5a729f5765516321366ef4ac401821431d408897e95287d0a
IMG_OPENRESTY: openresty/openresty@sha256:8dddb7eef46975651752294138269b2c450ce89d1810113997df254725f5fa9a
IMG_DEBIAN: debian@sha256:9c6e381421d0f48d1b8133e573f33c185ee16cbf505eda9c4a8a4791b25ea8a6
IMG_UBUNTU: ubuntu@sha256:73b999393d07f2bf65a40373778a44dc9a6d54ad7718d29247d8ff9413c4d6a8
IMG_ALMA: almalinux@sha256:02df05719ef287ebd0df0a1eedb9172a00bd70703aed7b25660e426b8e0d6047

jobs:
shellcheck:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: shellcheck
run: >-
shellcheck -S warning
"$DIR/detect-nginx-http2.sh" "$DIR/ssh-nginx-http2.sh"
"$DIR/tests/run-tests.sh" "$DIR/tests/fake-nginx"

test-linux:
name: bash on ${{ matrix.os }} (with Docker)
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-22.04]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Pull container images
run: |
for i in "$IMG_ORG" "$IMG_ALPINE" "$IMG_OPENRESTY" "$IMG_DEBIAN" "$IMG_UBUNTU" "$IMG_ALMA"; do
docker pull -q "$i"
done
- name: Run tests
run: ./"$DIR"/tests/run-tests.sh

# macOS ships bash 3.2; the decision-logic tests run there without Docker.
test-macos:
name: bash 3.2 on macos-latest
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run tests
run: /bin/bash "$DIR/tests/run-tests.sh" --no-docker
310 changes: 310 additions & 0 deletions CVE-2026-123633.CVE-2026-123007/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
# CVE-2026-123007, CVE-2026-123633 and CVE-2026-123634 (nginx) detection

Fleet checks for three nginx worker memory-corruption bugs that were fixed
together in nginx 1.30.7 and 1.31.9 on 2026-11-18. Each one is reached
through a feature the config has to turn on:

| CVE | nginx.org title | Severity (nginx.org) | Feature | Affected | Fixed |
|---|---|---|---|---|---|
| CVE-2026-123007 | Memory corruption in HTTP/2 flow control | major | HTTP/2 | 1.9.5-1.31.8 | 1.30.7+, 1.31.9+ |
| CVE-2026-123633 | Use-after-free in HTTP/2 | medium | HTTP/2 | 1.19.7-1.31.8 | 1.30.7+, 1.31.9+ |
| CVE-2026-123634 | Use-after-free during response processing in resolver | medium | `resolver` | 0.6.18-1.31.8 | 1.30.7+, 1.31.9+ |

**The HTTP/2 pair.** Wiz rates both CVSS 4.0 9.2 and shows remote code
execution in a worker process.
- CVE-2026-123007 is a send-window overflow reached with many
`WINDOW_UPDATE` frames. Wiz tested it over TLS on 64-bit builds.
- CVE-2026-123633 is a use-after-free that occurs when `worker_connections`
run out. Wiz says it is easiest to exploit in reverse-proxy setups.

**The resolver bug.** CVE-2026-123634 is not in the Wiz write-up. The nginx
changelog says that "if the "resolver" directive was used and the same name
was simultaneously resolved in subrequests", a worker can use memory after
freeing it. The stated impact is a segmentation fault in a worker process,
"or might have potential other impact". Turning HTTP/2 off does nothing for
this one; it needs an upgrade.

The same releases fix seven other CVEs, including CVE-2026-121810, a similar
use-after-free in HTTP/3. These scripts check only the three CVEs above; see
the nginx.org advisories page for the others.

## Directory contents

`linux/` holds bash scripts for Linux and macOS hosts.

| File | Purpose |
|---|---|
| `linux/detect-nginx-http2.sh` | Host detector (bash 3.2+). The name predates CVE-2026-123634; it checks all three CVEs. |
| `linux/ssh-nginx-http2.sh` | Fleet run over plain SSH |
| `linux/k8s-nginx-http2.yaml` | Fleet run as a privileged Kubernetes DaemonSet |

The SSH wrapper finds the detector next to itself, so keep the files
together. `linux/tests/` holds the maintainers' test harness. It is not needed
to run any script.

## What counts as impacted

A CVE applies to an nginx when its version, backport and feature checks all
show `[!]`. An nginx is impacted when at least one CVE applies, and the
result line lists the CVEs that do (`=> [!] impacted: CVE-2026-123634`).

1. **version**: `nginx -V` reports a version that has at least one of the bugs.
- nginx open source: from 0.6.18 (CVE-2026-123634), 1.9.5
(CVE-2026-123007) or 1.19.7 (CVE-2026-123633), through 1.31.8. 1.30.7
and later 1.30.x releases are fixed.
- NGINX Plus (read from `(nginx-plus-r...)` in the version string):
- R-series (R36 and earlier): affected; no R-series fix exists.
- PLS.37.0.x LTS: all three before 37.0.7; CVE-2026-123007 and
CVE-2026-123634 in 37.0.7; fixed from 37.0.8.
- PLS.37.x CR: all three in 37.1.x; CVE-2026-123007 and CVE-2026-123634
in 37.2.x; fixed from 37.3.0.
- 38 and later: not affected.
- OpenResty: judged on its nginx core (`openresty/1.27.1.2` → 1.27.1). A
fixed core is `OK`; an affected core is `[?]`, because OpenResty may ship
its own patches.
- Angie, Tengine, freenginx and other forks: always `[?]`; check the
vendor's advisory.
2. **backport**: the package that owns the binary records no fix. Debian,
Ubuntu and RHEL-family vendors patch without changing the upstream version
and name each CVE in the package changelog. The script looks for each CVE
ID separately, so a package that fixes some of them is still checked for
the rest:
- **dpkg:** `/usr/share/doc/<pkg>/changelog.Debian.gz`.
- **rpm:** `rpm -q --changelog`.
- **Alpine:** apk packages have no changelog on disk. A vendor Alpine
package is `[?]`; check [secdb](https://secdb.alpinelinux.org).
- **Judged on version alone:** binaries no package owns, nginx.org
packages (maintainer "NGINX Packaging", Debian, RPM or Alpine), and
NGINX Plus.

If the package on disk carries a fix but a running master still runs the
binary it replaced, the result is `[!]` with "restart nginx".
3. **feature**: the config uses what the bug is in.
- **http/2** (CVE-2026-123007, CVE-2026-123633): the binary was built with
`--with-http_v2_module`, and HTTP/2 is on for at least one server:
- the `http2` parameter of a `listen` directive, or
- `http2 on;` in that `server {}`, or inherited from `http {}`.

A server with `http2 off;` does not inherit an `http`-level `http2 on;`.
- **resolver** (CVE-2026-123634): a `resolver` directive anywhere in
`http {}`: at the `http`, `server` or `location` level, or in an
`upstream` block (1.27.3+). Resolvers in `stream {}` and `mail {}` do not
count, because the bug needs HTTP subrequests. Subrequests come from many
modules (`auth_request`, SSI, `mirror`, `slice`, `addition`, njs, Lua),
so the script does not try to rule them out: a configured resolver counts
as exposed.

The script reads the config files itself, starting at the master's `-c` file
(or the binary's built-in `--conf-path`) and following `include` directives,
globs and symlinks. It skips comments, quoted strings and the Lua code in
`*_by_lua_block` blocks. It does **not** run `nginx -t`/`nginx -T`, so it
needs no TLS keys, does not resolve upstream hostnames, and writes nothing.
The only command it runs from an nginx install is `nginx -V`. Inside a
container, rpm-based images are an exception: the script runs the container's
own `rpm` to read the package changelog.

The config files on disk are what nginx loads on its next reload. If someone
edited them without reloading, the running config may differ.

## Output

```
nginx check: CVE-2026-123007, CVE-2026-123633 (HTTP/2) and CVE-2026-123634 (resolver)
legend: [!] impacted | OK not impacted | [?] could not check | n/a not checked
checks: version, backport, then http/2 (CVE-2026-123007, CVE-2026-123633) or resolver (CVE-2026-123634).
A CVE applies only if version, backport and its own check all show [!].
host: Linux x86_64

/usr/sbin/nginx (pid 812)
version: nginx/1.24.0 (Ubuntu): CVE-2026-123007 CVE-2026-123633 CVE-2026-123634 [!]
backport: nginx 1.24.0-2ubuntu7.19 (dpkg), changelog does not list CVE-2026-123007 CVE-2026-123633 CVE-2026-123634 [!]
http/2: on, listen 443 ssl http2 (/etc/nginx/sites-enabled/default) [!]
resolver: not set (/etc/nginx/nginx.conf) OK
=> [!] impacted: CVE-2026-123007 CVE-2026-123633

/usr/sbin/nginx (pid 40211, container web-6c9f7d8b5-x2x7q)
version: nginx/1.30.6: CVE-2026-123007 CVE-2026-123633 CVE-2026-123634 [!]
backport: nginx 1.30.6-1~trixie (dpkg), nginx.org package: fixed only by upgrading [!]
http/2: off (/etc/nginx/nginx.conf) OK
resolver: on, resolver 10.96.0.10 valid=10s (/etc/nginx/conf.d/default.conf) [!]
=> [!] impacted: CVE-2026-123634

impacted
```

Each nginx instance gets one block. Each check ends in one of four markers:

- `[!]`: points to impacted.
- `OK`: rules this instance out.
- `[?]`: could not check.
- `n/a`: not checked, because no open CVE depends on it. For example, the
feature checks are `n/a` once the version or the backport rules out every
CVE they gate.

The title line names the binary and where it came from:

- `installed`: found on disk, not running.
- `pid N`: a running master process.
- `container <hostname>`: a master in a container. In Kubernetes the hostname
is the pod name; in Docker it is the short container ID.
- `-n`: a binary passed on the command line.

The http/2 and resolver lines name the file and directive that turned the
feature on. `-q` prints only the verdict line.

## Exit codes

| Code | Last line | Meaning |
|---|---|---|
| 0 | `not impacted` | no CVE applies to any nginx, or no nginx was found |
| 1 | `impacted` | at least one CVE applies to at least one nginx |
| 2 | `unknown` | at least one nginx could not be evaluated and none is impacted |
| 3 | (usage) | bad arguments |

## Usage

```sh
sudo ./linux/detect-nginx-http2.sh # per-instance blocks, then the verdict
sudo ./linux/detect-nginx-http2.sh -q # verdict only
./linux/detect-nginx-http2.sh -n /opt/app/sbin/nginx -c /opt/app/conf/nginx.conf
sudo ./linux/detect-nginx-http2.sh --no-disk # running instances only
```

Run as root. Without root, the script cannot read the master process (it
usually runs as root), containers, or root-only config files. Those instances
come out `[?]`.

## Coverage

| | bash (Linux) | bash (macOS) |
|---|---|---|
| nginx/openresty/angie on PATH and common install dirs | yes | yes (incl. Homebrew) |
| Running master processes, with their `-c`/`-p` | yes | yes |
| Masters in containers (Docker, containerd, Kubernetes pods) | yes, root + `nsenter` | no |
| Package backports: dpkg, rpm | yes (rpm in containers needs the container's `rpm`) | n/a |
| Running binary replaced on disk since start | detected; the old binary is checked through `/proc/PID/exe` | no |

Not covered:
- Windows nginx builds.
- `-g` directives given on the command line.
- Configs generated at start-up that are not on disk.

The scripts also do not reach managed services that run nginx for you, such
as cloud load balancers or a CDN. Check those vendors' advisories.

### Kubernetes ingress

`ingress-nginx` controller pods run nginx with HTTP/2 enabled by default and
set `resolver` to the cluster DNS, so expect the detector to report all three
CVEs for them. The DaemonSet below checks them like any other container. The
`kubernetes/ingress-nginx` project ended maintenance in March 2026 and
releases no security fixes
([Kubernetes blog](https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/)).
Turning HTTP/2 off does not cover CVE-2026-123634, so plan a migration rather
than waiting for an update. F5's NGINX Ingress Controller ships with NGINX
open source or NGINX Plus and follows their releases.

## Fleet runs

### SSH

`ssh-nginx-http2.sh` runs the detector across Linux/macOS hosts with no Ansible
and nothing installed: `detect-nginx-http2.sh` is piped to each host's bash
over stdin and run there, so nothing is copied to or left on the target.

```sh
sh linux/ssh-nginx-http2.sh hosts.txt results # one host or user@host per line
PARALLEL=20 sh linux/ssh-nginx-http2.sh hosts.txt
DETECT_ARGS="-q" sh linux/ssh-nginx-http2.sh hosts.txt # save just the verdict line
SUDO="" sh linux/ssh-nginx-http2.sh hosts.txt # run as the login user (less coverage)
```

It needs key-based SSH and, for full coverage, passwordless sudo and bash on
the targets.
- Each host's output goes to `results/<host>.txt`.
- The per-host exit code is the verdict (`0/1/2`, or `255`/other for an SSH
failure). A `0/1/2` counts only when the detector's last line agrees with
it; otherwise the host is an error. sudo and the remote shell also exit `1`
when they fail (for example `sudo: a password is required`), and that
would otherwise read as impacted.
- A roll-up of impacted / unknown / not impacted / error hosts prints at the
end.
- The wrapper exits `1` if any host is impacted, else `2` if any host is
unknown or errored, else `0`.

### Kubernetes

`k8s-nginx-http2.yaml` is a DaemonSet: one pod per node, with `hostPID` and
`privileged`, so the detector checks every nginx on the node, including those
in other pods (through its own `nsenter` path, as root). Nothing is copied
into workloads. The detector is mounted from a ConfigMap:

```sh
kubectl create namespace nginxh2
kubectl -n nginxh2 create configmap detect --from-file=linux/detect-nginx-http2.sh
kubectl apply -f linux/k8s-nginx-http2.yaml
kubectl -n nginxh2 rollout status daemonset/nginxh2
kubectl -n nginxh2 logs -l app=nginxh2 --tail=-1 --prefix --max-log-requests=500
kubectl delete namespace nginxh2
```

The pod is privileged by design. Review the manifest and delete the namespace
when you have your results. The base image installs `util-linux` (for
`nsenter`) at start; for air-gapped clusters, bake bash + util-linux + the
script into your own image.

## Remediation

1. **Upgrade.** This is the only fix that covers all three CVEs.
- Install nginx 1.30.7 / 1.31.9 or later, NGINX Plus PLS.37.0.8.1 LTS /
PLS.37.3.0.1 CR, or your distribution's patched package.
- Then make sure the old master is gone: a binary upgrade or a restart.
`nginx -s reload` alone does not replace the binary.
- Re-run the detector: a master still running a replaced binary is reported
with "restart nginx".
2. **Until you can upgrade, CVE-2026-123007 and CVE-2026-123633:** turn HTTP/2
off.
- nginx 1.25.1 and later: set `http2 off;` in the affected `server` blocks
(or in `http {}`), and remove `http2` from every `listen` directive.
- Older versions: remove `http2` from every `listen` directive.

Reload, confirm the old workers have exited, and re-run the detector: the
http/2 line names the file and directive it still finds. Clients fall back
to HTTP/1.1. gRPC proxying (`grpc_pass`) and any client that requires
HTTP/2 will stop working, so check those first.
3. **Until you can upgrade, CVE-2026-123634:** nginx publishes no workaround.
Removing every `resolver` directive avoids the bug only if nothing depends
on resolving names while nginx runs. These depend on it:
- `proxy_pass` (or `fastcgi_pass`, `grpc_pass` and similar) with a
variable in the address.
- `server ... resolve` in an upstream.
- OCSP stapling (`ssl_stapling`).

Without a resolver, those fail. In most setups that use a resolver,
upgrading is the practical fix.

## Sources

- nginx.org security advisories:
<https://nginx.org/en/security_advisories.html>
- CVE-2026-123007: "Vulnerable: 1.9.5-1.31.8. Not vulnerable: 1.31.9+,
1.30.7+".
- CVE-2026-123633: "Vulnerable: 1.19.7-1.31.8. Not vulnerable: 1.31.9+,
1.30.7+".
- CVE-2026-123634: "Vulnerable: 0.6.18-1.31.8. Not vulnerable: 1.31.9+,
1.30.7+".
- Changelogs: `CHANGES` for 1.31.9 and `CHANGES-1.30` for 1.30.7, both dated
18 Nov 2026.
- F5 advisories: K000163926 (CVE-2026-123007), K000163928 (CVE-2026-123633)
and K000163925 (CVE-2026-123634).
- NGINX Plus fix versions: the release notes at
<https://docs.nginx.com/nginx/releases/>. CVE-2026-123634 is listed under
PLS.37.0.8.1 LTS and PLS.37.3.0.1 CR.
- `resolver` contexts: the `ngx_http_core_module` and
`ngx_http_upstream_module` docs on nginx.org.
- Wiz Research write-up (HTTP/2 CVEs only):
<https://www.wiz.io/blog/nginx-http2-rce-vulnerabilities>.

As of 2026-11-18, no Debian, Ubuntu or AlmaLinux package changelog listed any
of the three CVEs. When vendors ship fixes, the backport check picks them up
with no script change.
Loading
Loading