From 8feb07ea256f8330e8002cb0f4b2803568c44a6c Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 18 May 2026 06:48:49 -0400 Subject: [PATCH] import UBI nginx-1.20.1-24.el9_7.3 --- ...escaping-and-possible-buffer-overrun.patch | 42 +++++++++++++++++++ SPECS/nginx.spec | 10 ++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0019-Rewrite-fixed-escaping-and-possible-buffer-overrun.patch diff --git a/SOURCES/0019-Rewrite-fixed-escaping-and-possible-buffer-overrun.patch b/SOURCES/0019-Rewrite-fixed-escaping-and-possible-buffer-overrun.patch new file mode 100644 index 0000000..e1d4e67 --- /dev/null +++ b/SOURCES/0019-Rewrite-fixed-escaping-and-possible-buffer-overrun.patch @@ -0,0 +1,42 @@ +From 63301166f15b8e696e25a63e3b8fc1984f5e630e Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan +Date: Wed, 22 Apr 2026 09:39:31 +0400 +Subject: [PATCH] Rewrite: fixed escaping and possible buffer overrun + +The following code resulted in incorrect escaping of $1 and possible +segfault: + + location / { + rewrite ^(.*) /new?c=1; + set $myvar $1; + return 200 $myvar; + } + +If there were arguments in a rewrite's replacement string, the is_args flag +was set and incorrectly never cleared. This resulted in escaping applied +to any captures evaluated afterwards in set or if. Additionally buffer was +allocated by ngx_http_script_complex_value_code() without escaping expected, +thus this also resulted in buffer overrun and possible segfault. + +A similar issue was fixed in 74d939974d43. + +Reported by Leo Lin. +--- + src/http/ngx_http_script.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c +index 13c57d6..302f842 100644 +--- a/src/http/ngx_http_script.c ++++ b/src/http/ngx_http_script.c +@@ -1164,6 +1164,7 @@ ngx_http_script_regex_end_code(ngx_http_script_engine_t *e) + + r = e->request; + ++ e->is_args = 0; + e->quote = 0; + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, +-- +2.44.0 + diff --git a/SPECS/nginx.spec b/SPECS/nginx.spec index 21d194e..4e52a17 100644 --- a/SPECS/nginx.spec +++ b/SPECS/nginx.spec @@ -41,7 +41,7 @@ Name: nginx Epoch: 2 Version: 1.20.1 -Release: 24%{?dist}.2 +Release: 24%{?dist}.3 Summary: A high performance web server and reverse proxy server # BSD License (two clause) @@ -135,6 +135,10 @@ Patch17: 0017-Mail-fixed-clearing-s-passwd-in-auth-http-requests.patch # upstream patch - https://github.com/nginx/nginx/commit/7725c372c2f Patch18: 0018-Mp4-avoid-zero-size-buffers-in-output.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2026-42945 +# upstream patch - https://github.com/nginx/nginx/commit/524977e7 +Patch19: 0019-Rewrite-fixed-escaping-and-possible-buffer-overrun.patch + BuildRequires: make BuildRequires: gcc BuildRequires: gnupg2 @@ -644,6 +648,10 @@ fi %changelog +* Thu May 14 2026 Luboš Uhliarik - 2:1.20.1-24.3 +- Resolves: RHEL-176230 - nginx: NGINX: Arbitrary Code Execution + Vulnerability (CVE-2026-42945) + * Tue Mar 31 2026 Zdenek Dohnal - 2:1.20.1-24.2 - Resolves: RHEL-159557 - CVE-2026-27654 nginx: NGINX: Denial of Service or file modification via buffer overflow in ngx_http_dav_module - Resolves: RHEL-159536 - CVE-2026-27784 nginx: NGINX: Denial of Service due to memory corruption via crafted MP4 file