Skip to content

nginx: cover CVE-2026-121810 (HTTP/3) and CVE-2026-113425 (mail proxy), add Ansible and kubectl exec wrappers - #11

Merged
kurt-r2c merged 2 commits into
mainfrom
nginx-http3-mail
Nov 18, 2026
Merged

kurt-r2c merged 2 commits into
mainfrom
nginx-http3-mail

Conversation

@diptendur2c

Copy link
Copy Markdown
Contributor

Supersedes #10: the same two commits, re-created from my work account and signed, because the repo requires signed commits. The file contents are byte-identical to what was approved there.

Extends the nginx detector merged in #8 from three CVEs to all five that nginx fixed in 1.30.7 and 1.31.9, and adds the two fleet wrappers the directory was missing. This replaces #9.

What it covered before

CVE Feature Checked on main
CVE-2026-123007 HTTP/2 flow-control window overflow yes
CVE-2026-123633 HTTP/2 use-after-free yes
CVE-2026-123634 resolver use-after-free yes
CVE-2026-121810 HTTP/3 use-after-free no
CVE-2026-113425 mail proxy use-after-free no

So a host with HTTP/2 off and no resolver, but with a QUIC listener or a mail proxy, came back not impacted with exit 0 while still exposed. Fleet wrappers: SSH and the Kubernetes DaemonSet.

What it covers now

All five. The two new checks follow the shape of the existing ones (version, backport, then the feature the bug is in):

CVE Affected Feature check
CVE-2026-121810 1.25.0 to 1.31.8 http/3: built with --with-http_v3_module, and a listen directive with the quic parameter in an http server {}
CVE-2026-113425 0.5.33 to 1.31.8 mail: built with --with-mail (or --with-mail=dynamic), and a server {} in mail {}

Fleet wrappers: SSH, the Kubernetes DaemonSet, and now Ansible and kubectl exec.

What was added

Detector (linux/detect-nginx-http2.sh)

  • The two CVEs in the version table. from_base now starts at 0.5.33, the oldest of the five.
  • NGINX Plus: both are fixed in 37.0.8 / 37.3.0, together with CVE-2026-123007 and CVE-2026-123634. The NGINX Plus release notes list all four under PLS.37.0.8.1 LTS and PLS.37.3.0.1 CR.
  • Two more config facts: a quic listener in an http server, and a server in mail {}.
  • Two more check lines in each block, http/3 and mail, with not built when the module is missing.
  • The backport check is unchanged. It already looks for each CVE that applies, so a package that fixes some of the five is still checked for the rest.

New wrappers

  • linux/ansible-nginx-http2.yml: runs the detector on every host in an inventory and collects the verdicts, adapted from the JDK playbook. A verdict counts only when the detector's last line agrees with the exit code, as in the SSH wrapper.
  • linux/k8s-exec-nginx-http2.sh: runs the detector inside every running container with kubectl exec, for clusters that forbid the privileged DaemonSet. It prints one line per container that is not impacted and the full output for the rest.

Existing wrappers

  • ssh-nginx-http2.sh and k8s-nginx-http2.yaml only run the detector and read its verdict, so they cover all five with no logic change. Their header text and the SSH roll-up title now name five CVEs.

Tests

  • Version, NGINX Plus and config cases for the two CVEs, including build flags (--with-mail_ssl_module alone does not count as the mail module).
  • A real-nginx case: the nginx.org Alpine image with a QUIC listener and a mail server that nginx itself accepts must report all five.
  • A new section that drives the SSH and kubectl exec wrappers through stand-ins for ssh and kubectl. It needs no Docker.
  • Two existing fixtures contain a mail server to show that mail is ignored for HTTP/2 and the resolver. They now also report the mail CVE, and their expectations say so.
  • The distro-changelog oracle now asks for every CVE the container's nginx version has (four before 1.25.0, five from it).

Docs: the directory README (tables, feature checks, output, remediation for the two CVEs, the new wrappers, sources), the root README row, and the workflow name. The workflow's shellcheck step also checks the new script.

Sample output

A real run inside the nginx.org Alpine image (nginx 1.30.6) with HTTP/2 off, no resolver, a QUIC listener and an IMAP proxy. nginx accepted this config.

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

/usr/sbin/nginx (pid 1)
  version: nginx/1.30.6: CVE-2026-123007 CVE-2026-123633 CVE-2026-123634 CVE-2026-121810 CVE-2026-113425 [!]
  backport: nginx 1.30.6-r1 (apk), nginx.org package: fixed only by upgrading [!]
  http/2: off (/etc/nginx/nginx.conf) OK
  resolver: not set (/etc/nginx/nginx.conf) OK
  http/3: on, listen 443 quic (/etc/nginx/conf.d/h3.conf) [!]
  mail: on, mail server (/etc/nginx/nginx.conf) [!]
  => [!] impacted: CVE-2026-121810 CVE-2026-113425

impacted

Exit code 1. On main, the same kind of host ends in => OK and not impacted, exit 0.

Design notes

  • HTTP/3 needs only a QUIC listener. The script does not ask whether requests are proxied or whether worker_connections can run out, matching how it treats the HTTP/2 use-after-free and nginx's own advisory wording.
  • Any mail server counts. nginx will not start a mail server without auth_http, and the same release fixed several mail code paths under this CVE.
  • Order of CVEs in the output is unchanged for the first three; the two new ones are appended.

Tested

Run locally on Ubuntu 22.04 under WSL (x86_64, Docker):

  • Full suite: 129 pass, including the real-nginx containers (nginx.org Debian and Alpine 1.30.6, OpenResty, and the Debian 13, Ubuntu 24.04 and AlmaLinux 9 packages) and the privileged --pid=host scan.
  • Logic and wrapper sections under bash 3.2.57 (the bash:3.2 image): 106 pass.
  • shellcheck -S warning is clean on all five scripts.
  • By hand: real nginx 1.31.8 and 1.31.9 built from source. 1.31.8 with a mail-only or HTTP/3-only config is now impacted; 1.31.9 is not.

Not verified

  • The Ansible playbook was not run. It parses as YAML and follows the JDK playbook's structure.
  • k8s-exec-nginx-http2.sh was tested against a stand-in kubectl, not a live cluster.
  • macOS: not run locally. The existing macOS job in this workflow runs the logic and wrapper sections.
  • No real NGINX Plus host, as before.

🤖 Generated with Claude Code

diptendur2c and others added 2 commits November 18, 2026 13:44
The detector checked three of the five nginx CVEs fixed in 1.30.7 and
1.31.9. A host with HTTP/2 off and no resolver, but with a QUIC listener
or a mail proxy, came back "not impacted" while still exposed. This adds
the other two, in the same shape as the existing checks:

- version: CVE-2026-121810 from 1.25.0, CVE-2026-113425 from 0.5.33.
  NGINX Plus fixes both in 37.0.8 / 37.3.0, with CVE-2026-123007 and
  CVE-2026-123634 (release notes for PLS.37.0.8.1 and PLS.37.3.0.1).
- http/3: built with --with-http_v3_module, and a listen directive with
  the quic parameter in an http server{}.
- mail: built with --with-mail (or --with-mail=dynamic), and a server{}
  in mail{}.

The backport check needs no change: it already looks for each CVE that
applies. Two existing fixtures contain a mail server and now report the
mail CVE; their expectations are updated.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
…pers

- ansible-nginx-http2.yml runs the detector on every host in an
  inventory and collects the verdicts, like the JDK playbook. A verdict
  counts only when the detector's last line agrees with the exit code,
  as in the SSH wrapper.
- k8s-exec-nginx-http2.sh runs the detector inside every running
  container with kubectl exec, for clusters that forbid the privileged
  DaemonSet.
- The test harness gains a section that drives the SSH and kubectl exec
  wrappers through stand-ins for ssh and kubectl. It needs no Docker and
  runs under bash 3.2.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
printf '=== %s/%s/%s (node %s) ===\nunknown: no bash in this container; use the DaemonSet (k8s-nginx-http2.yaml)\n' "$ns" "$pod" "$ctr" "$node"
unk=$((unk + 1))
fi
IFS=$NL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium severity issue identified in your code:

Global IFS=$NL makes unquoted $LIST parsing depend on newline data, allowing injected records to control the kubectl exec target fields. An attacker who can influence LIST may redirect the detector to a chosen container and expose its output.

More details about this

IFS=$NL changes the shell’s global field-splitting rules before for line in $LIST. Because $LIST is expanded unquoted, every newline in its contents becomes a new line; each resulting line is then split by set -- $line after IFS is changed to a space. This makes the parsing of LIST depend on mutable global shell state and lets unexpected data create or reshape ns, pod, ctr, and node values used by kubectl exec.

A plausible attack is:

  1. An attacker causes the command that populates LIST to include a newline in its output, followed by attacker-ns attacker-pod attacker-ctr attacker-node.
  2. With IFS=$NL, for line in $LIST treats that injected text as a separate record.
  3. IFS=' ' and set -- $line assign the attacker-controlled fields to ns, pod, ctr, and node.
  4. The script then runs kubectl exec -n "$ns" "$pod" -c "$ctr", causing the detector to access the attacker-selected container and potentially disclose its command output through out and the printed report. If the selected container is privileged or holds sensitive service-account permissions, the detector’s execution occurs in that security context.

To resolve this comment:

✨ Commit fix suggestion
  1. Remove the global IFS=$NL assignments, including the final IFS=' ' assignment.
  2. Replace for line in $LIST; do with a line-oriented read loop: while IFS= read -r line; do.
  3. Skip empty lines if LIST can contain them by adding [ -n "$line" ] || continue.
  4. Replace IFS=' ' followed by set -- $line with a local read assignment: IFS=' ' read -r ns pod ctr node <<< "$line".
  5. Read the list without an unquoted expansion by closing the loop with done < <(printf '%s' "$LIST"). The IFS assignment applies only to the individual read command, so later variable expansions retain normal shell behavior.
💬 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 ifs-tampering.

You can view more details about this finding in the Semgrep AppSec Platform.

@kurt-r2c
kurt-r2c merged commit 3a2b9a8 into main Nov 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants