Repository navigation
nginx: detectors for CVE-2026-123007, CVE-2026-123633 (HTTP/2) and CVE-2026-123634 (resolver) - #8
Conversation
Host detector (bash 3.2+) for the two nginx HTTP/2 worker memory-corruption bugs fixed in nginx 1.30.7 / 1.31.9 on 2026-11-18. An nginx is impacted when its version is affected, no distro backport is recorded in the package changelog, and its config turns HTTP/2 on. The config is parsed directly (includes, globs, symlinks, Lua blocks); nginx -T is not run. Covers running masters (including containers via nsenter), installed binaries, NGINX Plus PLS.37 / R-series, and OpenResty and other forks (reported unknown). Adds SSH and Kubernetes DaemonSet fleet wrappers, a test harness (fake nginx plus real nginx.org, OpenResty, Debian, Ubuntu and AlmaLinux builds in Docker), and a CI workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| labels: | ||
| app: nginxh2 | ||
| spec: | ||
| hostPID: true |
There was a problem hiding this comment.
🟡 Medium severity issue identified in your code:
The privileged DaemonSet shares each node’s process namespace through hostPID: true, exposing host processes to a compromised detect container. An attacker could inspect or attach to node processes and use their credentials to escalate to node or Kubernetes access.
More details about this
spec.hostPID: true places every nginxh2 pod in the node's process-ID namespace. Because the container is also privileged: true, a compromise of the detect container can access and interact with host processes rather than being limited to processes in the container.
A plausible attack is:
- An attacker gains code execution in the
detectcontainer, for example through a vulnerability in the downloadeddetect-nginx-http2.shworkflow or thedebian:stable-slimruntime. - They inspect
/procand use the host PIDs exposed byhostPIDto identify node services, such as the container runtime, kubelet, or an application holding cloud or Kubernetes credentials. - They use the container's privileged context and tools such as
nsenter(installed by the command inargs) to enter a host process's namespaces, or attach withptracewhere permitted. - From that host context, they can read process memory or credentials, execute commands as a host process, and potentially obtain node-level access or Kubernetes credentials for workloads scheduled on the node.
This setting is especially risky in a DaemonSet because the privileged, host-process-visible container is deployed across every Linux node selected by nodeSelector, and tolerations allows it onto tainted nodes as well.
To resolve this comment:
✨ Commit fix suggestion
-
Remove
hostPID: truefrom the pod template:
spec.template.spec.hostPID -
Update
detect-nginx-http2.shso it does not inspect host processes or rely onnsenterto access the host PID namespace. Use a Kubernetes API, node-level metrics source, or another least-privilege data source instead. -
Keep the pod in its own PID namespace and verify that no container requires
hostPIDbefore applying the manifest.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by hostpid-pod.
You can view more details about this finding in the Semgrep AppSec Platform.
| - name: detect | ||
| image: debian:stable-slim | ||
| securityContext: | ||
| privileged: true |
There was a problem hiding this comment.
🟡 Medium severity issue identified in your code:
The detect container runs privileged on every eligible Linux node and also shares the host PID namespace. An attacker who can execute commands in it may enter host namespaces, access node credentials and workload data, or take over the node.
More details about this
nginxh2 is a DaemonSet that schedules the detect container on Linux nodes, and its securityContext.privileged: true grants that container broad host-level capabilities. Combined with hostPID: true, a process running in the container can see and interact with host processes and use tools such as nsenter (installed by the startup command) to enter the node's namespaces.
A plausible attack would be:
- An attacker gains the ability to run a command in the
detectcontainer, for example through a compromised workload or Kubernetes credential:kubectl -n nginxh2 exec -it <nginxh2-pod> -c detect -- /bin/sh
- Inside the container, they target the host's PID 1 process and enter its namespaces:
nsenter -t 1 -m -u -i -n -p -- /bin/sh
- From that shell, they can inspect or interfere with node processes and networking. Because
privileged: truealso provides powerful capabilities such asCAP_SYS_ADMIN, they can identify a host disk withlsblk, mount it, and read or alter node data such as kubelet credentials, container runtime state, and other workloads' secrets.
This is especially high impact because the DaemonSet's tolerations allow it to run broadly across nodes, so compromising one detect container can become a path to the underlying Kubernetes node and its workloads.
To resolve this comment:
✨ Commit fix suggestion
- Remove
privileged: truefrom the containersecurityContext, or remove thesecurityContextblock if it has no other settings. - Add a restrictive security context for the container:
allowPrivilegeEscalation: false,readOnlyRootFilesystem: true, andcapabilities: { drop: ["ALL"] }. - Remove
hostPID: truefrom the pod if the detection script does not need to inspect host processes. Avoiding host namespaces prevents the container from accessing the node’s process namespace. - Update
detect-nginx-http2.shto use Kubernetes APIs or node-exported data instead ofnsenterand host namespace access. - Alternatively, if host inspection is required, replace the script with a narrowly scoped node agent that uses only the specific Linux capabilities it needs, rather than enabling
privileged; do not grantSYS_ADMINor mount host filesystems unless the agent’s operation requires them and the access is explicitly reviewed.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by privileged-container.
You can view more details about this finding in the Semgrep AppSec Platform.
nginx 1.30.7 / 1.31.9 also fixed CVE-2026-123634, a use-after-free when the "resolver" directive is used and the same name is resolved in subrequests (vulnerable 0.6.18-1.31.8). Turning HTTP/2 off does not mitigate it, so a host the detector called "not impacted" after that mitigation could still be exposed. The detector now evaluates each CVE separately: version range, changelog backport per CVE ID, and the feature the bug is in (http/2 for CVE-2026-123007/123633, a resolver anywhere in http{} for CVE-2026-123634). The result line names the CVEs that apply. NGINX Plus fixes it in PLS.37.0.8.1 LTS / PLS.37.3.0.1 CR. README remediation now says HTTP/2-off covers only the HTTP/2 pair. Tests: 74 decision-logic checks (bash 3.2 and 5) and 21 real-nginx and container-scan checks, including a resolver-only nginx.org container that is impacted with HTTP/2 off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sudo -n exits 1 when the target needs a password ("sudo: a password is
required"), and so does sudo when bash is missing. The wrapper read that
exit code as the detector's "impacted" verdict, so hosts where the
detector never ran showed up as impacted.
Accept exit 0/1/2 only when the detector's last line (its verdict) agrees
with it; otherwise report the host as an error, naming sudo when stderr
shows it, and print a hint when sudo needs a password. Adds wrapper tests
with stub ssh and sudo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Host and fleet detectors for three nginx worker memory-corruption bugs fixed together in nginx 1.30.7 / 1.31.9 on 2026-11-18 (nginx.org advisories, Wiz write-up for the HTTP/2 pair):
resolverCVE-2026-123634 is not in the Wiz post; it was added in the second commit. Turning HTTP/2 off does not mitigate it, so without it a host could pass the check after applying the HTTP/2 workaround while still exposed.
Same contract as
CVE-2026-114938/: per-instance blocks with[!]/OK/[?]/n/a, last lineimpacted/not impacted/unknown, exit 0/1/2/3. The result line names the CVEs that apply (=> [!] impacted: CVE-2026-123634).What counts as impacted (per CVE: version, backport and its feature check must all be
[!])nginx -V.[?].[?].--with-http_v2_module, and the config enables it (listen ... http2, orhttp2 on;set in or inherited by a server).resolverdirective anywhere inhttp{}(http/server/location/upstream). Stream/mail resolvers don't count. Subrequests (auth_request, SSI, mirror, slice, njs, Lua...) are assumed rather than detected.*_by_lua_block.nginx -Tis not run, so no writes, TLS keys or DNS are needed.Coverage
-c/-p).nsenterand/proc/PID/root, labelled with the container hostname (the pod name in k8s).-n.Files
linux/detect-nginx-http2.sh: host detector. The name predates CVE-2026-123634; happy to rename the folder/script if reviewers prefer.linux/ssh-nginx-http2.sh,linux/k8s-nginx-http2.yaml: fleet wrappers adapted from the JDK ones. The DaemonSet is privileged by design, as before.linux/tests/: harness and fake nginx..github/workflows/nginx-http2-linux.yml:Tests (run locally: macOS arm64 plus Colima/Docker aarch64)
resolverwith HTTP/2 off makes them impacted by CVE-2026-123634 only.-c, and a non-root run.--pid=hostscan finds every container's nginx throughnsenter.Not yet verified
nginx-plus-r37.0.Nversion-string format is inferred from F5's install docs, and unrecognised Plus strings report[?].🤖 Generated with Claude Code