Skip to content

fix: upgrade nginx base image to fix CVE-2026-42945 (CVSS 9.2 critical RCE) - #1796

Open
zethis wants to merge 1 commit into
CorentinTh:mainfrom
zethis:fix/upgrade-nginx-cve-2026-42945
Open

fix: upgrade nginx base image to fix CVE-2026-42945 (CVSS 9.2 critical RCE)#1796
zethis wants to merge 1 commit into
CorentinTh:mainfrom
zethis:fix/upgrade-nginx-cve-2026-42945

Conversation

@zethis

@zethis zethis commented May 14, 2026

Copy link
Copy Markdown

What

Switches the production stage base image from nginx:stable-alpine to nginx:1.31-alpine.

Why

CVE-2026-42945 — Heap-based Buffer Overflow in ngx_http_rewrite_module

  • CVSS v4: 9.2 (Critical)
  • Impact: Unauthenticated remote attacker can crash nginx worker processes or achieve Remote Code Execution on systems with ASLR disabled
  • Affected: nginx 0.6.27 – 1.30.0 (current nginx:stable-alpine ships 1.26.x)
  • Fixed in: nginx 1.30.1 / 1.31.0
  • PoC: Publicly available since 2026-05-13
  • Advisory: https://nginx.org/en/security_advisories.html (F5 K000161019)

Change

-FROM nginx:stable-alpine AS production-stage
+FROM nginx:1.31-alpine AS production-stage

nginx:stable-alpine currently resolves to nginx 1.26.x which is vulnerable. Pinning to 1.31-alpine ensures the patched version is used. This can be reverted to nginx:stable-alpine once the stable branch is updated upstream by the nginx team.

Switch from nginx:stable-alpine (1.26.x, vulnerable) to nginx:1.31-alpine
which includes the fix for CVE-2026-42945, a heap buffer overflow in
ngx_http_rewrite_module allowing unauthenticated RCE.

Affected: nginx 0.6.27 – 1.30.0
Fixed in: nginx 1.30.1, 1.31.0
Ref: https://nginx.org/en/security_advisories.html
@sonarqubecloud

Copy link
Copy Markdown

@zethis

zethis commented May 14, 2026

Copy link
Copy Markdown
Author

The E2E test failure is unrelated to this change. The error is:

E: Package 'libasound2' has no installation candidate
E: Unable to locate package libffi7
E: Unable to locate package libx264-163
Failed to install browsers

These are Playwright browser dependencies that don't exist under their old names on Ubuntu Noble (24.04). The same failure is reproducible on other unrelated PRs (e.g. renovate/netmask-2.x-lockfile, add-russian-localization), confirming it's a pre-existing repo-wide CI issue.

Our change is a single-line Dockerfile bump with no effect on tests.

@sharevb

sharevb commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Hi @zethis if you are interested in an up to date version of it-tools, with many improvements, new tools, and bug fixes, as this repo is almost no more maintained, I made a fork here : https://github.com/sharevb/it-tools (https://sharevb-it-tools.vercel.app/ and docker images https://github.com/sharevb/it-tools/pkgs/container/it-tools)

kxhubs pushed a commit to kxhubs/it-tools that referenced this pull request Aug 2, 2026
Cherry-picked from upstream PR CorentinTh#1796 (zethis):
- Switch from nginx:stable-alpine (vulnerable 1.26.x) to nginx:1.31-alpine
- Fixes heap buffer overflow in ngx_http_rewrite_module allowing unauthenticated RCE
- Affected: nginx 0.6.27 - 1.30.0, fixed in 1.30.1/1.31.0
kxhubs pushed a commit to kxhubs/it-tools that referenced this pull request Aug 2, 2026
Cherry-picked from upstream PR CorentinTh#1499 (ombre8):
- Switch to nginxinc/nginx-unprivileged (runs as non-root user)
- Listen on port 8080 instead of 80
- Combined with PR CorentinTh#1796: pinned to 1.31-alpine for CVE-2026-42945 fix
- Update README docker run examples
kxhubs added a commit to kxhubs/it-tools that referenced this pull request Aug 2, 2026
Cherry-picked from upstream PR CorentinTh#1796 (zethis):
- Switch from nginx:stable-alpine (vulnerable 1.26.x) to nginx:1.31-alpine
- Fixes heap buffer overflow in ngx_http_rewrite_module allowing unauthenticated RCE
- Affected: nginx 0.6.27 - 1.30.0, fixed in 1.30.1/1.31.0
kxhubs added a commit to kxhubs/it-tools that referenced this pull request Aug 2, 2026
Cherry-picked from upstream PR CorentinTh#1499 (ombre8):
- Switch to nginxinc/nginx-unprivileged (runs as non-root user)
- Listen on port 8080 instead of 80
- Combined with PR CorentinTh#1796: pinned to 1.31-alpine for CVE-2026-42945 fix
- Update README docker run examples
kxhubs added a commit to kxhubs/it-tools that referenced this pull request Aug 3, 2026
Cherry-picked from upstream PR CorentinTh#1796 (zethis):
- Switch from nginx:stable-alpine (vulnerable 1.26.x) to nginx:1.31-alpine
- Fixes heap buffer overflow in ngx_http_rewrite_module allowing unauthenticated RCE
- Affected: nginx 0.6.27 - 1.30.0, fixed in 1.30.1/1.31.0
kxhubs added a commit to kxhubs/it-tools that referenced this pull request Aug 3, 2026
Cherry-picked from upstream PR CorentinTh#1499 (ombre8):
- Switch to nginxinc/nginx-unprivileged (runs as non-root user)
- Listen on port 8080 instead of 80
- Combined with PR CorentinTh#1796: pinned to 1.31-alpine for CVE-2026-42945 fix
- Update README docker run examples
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