nginx: Security fixes
cover nginx: Security fixes
From: Hetvi Thakar <[email protected]>
This series backports the upstream nginx security fixes for the following CVEs to nginx 1.28.3 and 1.29.7 in Wrynose:
- CVE-2026-40701
- CVE-2026-42934
- CVE-2026-42946
- CVE-2026-42945
- CVE-2026-9256
- CVE-2026-42055
- CVE-2026-48142
- CVE-2026-42533
- CVE-2026-56434
Each fix was selected from the upstream commits referenced by the corresponding nginx security advisory.
The series also adds conditional CVE_STATUS entries for CVE-2026-40460 and CVE-2026-60005. These are not applicable when the HTTP/3 and slice modules, respectively, are disabled. They remain reported as unpatched when those modules are enabled.
Validation performed:
- The complete series applies cleanly to the Wrynose branch.
- bitbake nginx -c patch -f completed successfully.
- bitbake core-image-minimal completed successfully.
Hetvi Thakar (11):
nginx: Fix CVE-2026-40701
nginx: fix CVE-2026-42934
nginx: fix CVE-2026-42946
nginx: fix CVE-2026-42945
nginx: fix CVE-2026-9256
nginx: fix CVE-2026-42055
nginx: fix CVE-2026-48142
nginx: fix CVE-2026-42533
nginx: fix CVE-2026-56434
nginx: Ignore CVE-2026-40460
nginx: Ignore CVE-2026-60005
.../nginx/files/CVE-2026-40701.patch | 74 ++ .../nginx/files/CVE-2026-42533_p1.patch | 127 +++ .../nginx/files/CVE-2026-42533_p2.patch | 381 +++++++++ .../nginx/files/CVE-2026-42533_p3.patch | 704 +++++++++++++++++ .../nginx/files/CVE-2026-42533_p5.patch | 254 ++++++ .../nginx/files/CVE-2026-42934.patch | 80 ++ .../nginx/files/CVE-2026-42945.patch | 47 ++ .../nginx/files/CVE-2026-42946_p1.patch | 47 ++ .../nginx/files/CVE-2026-42946_p2.patch | 92 +++ .../nginx/files/CVE-2026-48142.patch | 42 + .../nginx/files/CVE-2026-56434.patch | 71 ++ .../nginx/files/CVE-2026-9256.patch | 77 ++ .../nginx/nginx-1.28.3/CVE-2026-42055.patch | 108 +++ .../nginx-1.28.3/CVE-2026-42533_p4.patch | 587 ++++++++++++++ .../nginx/nginx-1.29.7/CVE-2026-42055.patch | 188 +++++ .../nginx-1.29.7/CVE-2026-42533_p4.patch | 723 ++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 19 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 19 + 18 files changed, 3640 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-40701.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p1.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p2.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p3.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p5.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42934.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42945.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p1.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p2.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-48142.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-56434.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-9256.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42055.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42533_p4.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42055.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42533_p4.patch
Signature · 1 line
2.35.6
PATCH 1/11 nginx: Fix CVE-2026-40701
From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/d2b8d47741820c9fb134c6731ecb40b21f3085b1
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-40701.patch | 74 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 4 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 4 + 3 files changed, 82 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-40701.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-40701.patch new file +74 -0
@@ -0,0 +1,74 @@ +From d2b8d47741820c9fb134c6731ecb40b21f3085b1 Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan <[email protected]> +Date: Tue, 21 Apr 2026 14:51:41 +0400 +Subject: [PATCH] OCSP: resolve cleanup on connection close + +Previously, when a client SSL connection was terminated (typically due to a +timeout) while resolving an OCSP responder, the OCSP context was freed, but +the resolve context was not. This resulted in use-after-free on resolve +completion. + +Reported by Leo Lin. + +CVE: CVE-2026-40701 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/d2b8d47741820c9fb134c6731ecb40b21f3085b1] + +(cherry picked from commit d2b8d47741820c9fb134c6731ecb40b21f3085b1) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/event/ngx_event_openssl_stapling.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/event/ngx_event_openssl_stapling.c b/src/event/ngx_event_openssl_stapling.c +index a0a8031c7..231bdeceb 100644 +--- a/src/event/ngx_event_openssl_stapling.c ++++ b/src/event/ngx_event_openssl_stapling.c +@@ -113,6 +113,7 @@ struct ngx_ssl_ocsp_ctx_s { + + ngx_resolver_t *resolver; + ngx_msec_t resolver_timeout; ++ ngx_resolver_ctx_t *resolve; + + ngx_msec_t timeout; + +@@ -1341,6 +1342,10 @@ ngx_ssl_ocsp_done(ngx_ssl_ocsp_ctx_t *ctx) + ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0, + "ssl ocsp done"); + ++ if (ctx->resolve) { ++ ngx_resolve_name_done(ctx->resolve); ++ } ++ + if (ctx->peer.connection) { + ngx_close_connection(ctx->peer.connection); + } +@@ -1433,7 +1438,10 @@ ngx_ssl_ocsp_request(ngx_ssl_ocsp_ctx_t *ctx) + resolve->data = ctx; + resolve->timeout = ctx->resolver_timeout; + ++ ctx->resolve = resolve; ++ + if (ngx_resolve_name(resolve) != NGX_OK) { ++ ctx->resolve = NULL; + ngx_ssl_ocsp_error(ctx); + return; + } +@@ -1522,6 +1530,7 @@ ngx_ssl_ocsp_resolve_handler(ngx_resolver_ctx_t *resolve) + } + + ngx_resolve_name_done(resolve); ++ ctx->resolve = NULL; + + ngx_ssl_ocsp_connect(ctx); + return; +@@ -1529,6 +1538,8 @@ ngx_ssl_ocsp_resolve_handler(ngx_resolver_ctx_t *resolve) + failed: + + ngx_resolve_name_done(resolve); ++ ctx->resolve = NULL; ++ + ngx_ssl_ocsp_error(ctx); + } + +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +4 -0
@@ -1,5 +1,9 @@ require nginx.inc +SRC_URI:append = " \ + file://CVE-2026-40701.patch \ +" + LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593" SRC_URI[sha256sum] = "2c96a946bfb0882a21744ed429770a2123ae1828c7c48665092993ddee91a918"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +4 -0
@@ -1,5 +1,9 @@ require nginx.inc +SRC_URI:append = " \ + file://CVE-2026-40701.patch \ +" + # 1.28.x branch is the current stable branch, the recommended default # 1.29.x is the current mainline branches containing all new features DEFAULT_PREFERENCE = "-1"
Signature · 1 line
2.35.6
PATCH 2/11 nginx: fix CVE-2026-42934
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/54b7945961b2eaafc480d6b85d9635d0db1c126a
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-42934.patch | 80 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 3 files changed, 82 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42934.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42934.patch new file +80 -0
@@ -0,0 +1,80 @@ +From 54b7945961b2eaafc480d6b85d9635d0db1c126a Mon Sep 17 00:00:00 2001 +From: David Carlier <[email protected]> +Date: Sun, 12 Apr 2026 07:13:23 +0100 +Subject: [PATCH] Charset: fix buffer over-read in recode_from_utf8(). + +When a multi-byte UTF-8 character was split across 3+ single-byte +buffers, the saved bytes continuation path had two related bugs: + +ngx_utf8_decode() was called with the last saved-array index instead +of the byte count, causing it to report "incomplete" even when the +sequence was already complete. + +The subsequent ngx_memcpy() used that same index as the copy length, +reading past the input buffer boundary. + +CVE: CVE-2026-42934 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/54b7945961b2eaafc480d6b85d9635d0db1c126a] + +(cherry picked from commit 54b7945961b2eaafc480d6b85d9635d0db1c126a) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + .../modules/ngx_http_charset_filter_module.c | 20 ++++++------------- + 1 file changed, 6 insertions(+), 14 deletions(-) + +diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c +index 482960040..edb2db568 100644 +--- a/src/http/modules/ngx_http_charset_filter_module.c ++++ b/src/http/modules/ngx_http_charset_filter_module.c +@@ -689,7 +689,6 @@ ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, + u_char c, *p, *src, *dst, *saved, **table; + uint32_t n; + ngx_buf_t *b; +- ngx_uint_t i; + ngx_chain_t *out, *cl, **ll; + + src = buf->pos; +@@ -783,18 +782,12 @@ ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0, + "http charset utf saved: %z", ctx->saved_len); + +- p = src; +- +- for (i = ctx->saved_len; i < NGX_UTF_LEN; i++) { +- ctx->saved[i] = *p++; +- +- if (p == buf->last) { +- break; +- } +- } ++ len = ngx_min(NGX_UTF_LEN - ctx->saved_len, (size_t) (buf->last - src)); ++ ngx_memcpy(&ctx->saved[ctx->saved_len], src, len); ++ len += ctx->saved_len; + + saved = ctx->saved; +- n = ngx_utf8_decode(&saved, i); ++ n = ngx_utf8_decode(&saved, len); + + c = '\0'; + +@@ -810,7 +803,7 @@ ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, + + /* incomplete UTF-8 symbol */ + +- if (i < NGX_UTF_LEN) { ++ if (len < NGX_UTF_LEN) { + out = ngx_http_charset_get_buf(pool, ctx); + if (out == NULL) { + return NULL; +@@ -823,8 +816,7 @@ ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, + b->sync = 1; + b->shadow = buf; + +- ngx_memcpy(&ctx->saved[ctx->saved_len], src, i); +- ctx->saved_len += i; ++ ctx->saved_len = len; + + return out; + } +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -2,6 +2,7 @@ require nginx.inc SRC_URI:append = " \ file://CVE-2026-40701.patch \ + file://CVE-2026-42934.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -2,6 +2,7 @@ require nginx.inc SRC_URI:append = " \ file://CVE-2026-40701.patch \ + file://CVE-2026-42934.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 3/11 nginx: fix CVE-2026-42946
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
These patches apply the upstream fix sequence as referenced in [3], using the commits shown in [1] and [2].
[1] https://github.com/nginx/nginx/commit/baef7fdac28e4e1fe26509b50b8d15603393e28e
[2] https://github.com/nginx/nginx/commit/39d7d0ba0799fcff6baee52b6525f45739593cfd
[3] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-42946_p1.patch | 47 ++++++++++ .../nginx/files/CVE-2026-42946_p2.patch | 92 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 2 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 2 + 4 files changed, 143 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p1.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p2.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p1.patch new file +47 -0
@@ -0,0 +1,47 @@ +From baef7fdac28e4e1fe26509b50b8d15603393e28e Mon Sep 17 00:00:00 2001 +From: Sergey Kandaurov <[email protected]> +Date: Wed, 29 Apr 2026 21:56:51 +0400 +Subject: [PATCH] Upstream: reset parsing state after invalid status line + +Previously, it was possible to start parsing headers with a wrong +parsing state after status line was not recognized, as a fallback +used in the scgi and uwsgi modules. + +Reported by Leo Lin. + +CVE: CVE-2026-42946 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/baef7fdac28e4e1fe26509b50b8d15603393e28e] + +(cherry picked from commit baef7fdac28e4e1fe26509b50b8d15603393e28e) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/modules/ngx_http_scgi_module.c | 1 + + src/http/modules/ngx_http_uwsgi_module.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c +index 49977b07b..038380798 100644 +--- a/src/http/modules/ngx_http_scgi_module.c ++++ b/src/http/modules/ngx_http_scgi_module.c +@@ -1029,6 +1029,7 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r) + + if (rc == NGX_ERROR) { + u->process_header = ngx_http_scgi_process_header; ++ r->state = 0; + return ngx_http_scgi_process_header(r); + } + +diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c +index c1d0035cc..05c08b6c4 100644 +--- a/src/http/modules/ngx_http_uwsgi_module.c ++++ b/src/http/modules/ngx_http_uwsgi_module.c +@@ -1266,6 +1266,7 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r) + + if (rc == NGX_ERROR) { + u->process_header = ngx_http_uwsgi_process_header; ++ r->state = 0; + return ngx_http_uwsgi_process_header(r); + } + +-- +2.35.6
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42946_p2.patch new file +92 -0
92 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +2 -0
@@ -3,6 +3,8 @@ require nginx.inc SRC_URI:append = " \ file://CVE-2026-40701.patch \ file://CVE-2026-42934.patch \ + file://CVE-2026-42946_p1.patch \ + file://CVE-2026-42946_p2.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +2 -0
@@ -3,6 +3,8 @@ require nginx.inc SRC_URI:append = " \ file://CVE-2026-40701.patch \ file://CVE-2026-42934.patch \ + file://CVE-2026-42946_p1.patch \ + file://CVE-2026-42946_p2.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 4/11 nginx: fix CVE-2026-42945
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/524977e7c534e87e5b55739fa74601c9f1102686
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-42945.patch | 47 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 3 files changed, 49 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42945.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42945.patch new file +47 -0
@@ -0,0 +1,47 @@ +From 524977e7c534e87e5b55739fa74601c9f1102686 Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan <[email protected]> +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. + +CVE: CVE-2026-42945 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/524977e7c534e87e5b55739fa74601c9f1102686] + +(cherry picked from commit 524977e7c534e87e5b55739fa74601c9f1102686) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + 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 a2b9f1b7b..2ea611373 100644 +--- a/src/http/ngx_http_script.c ++++ b/src/http/ngx_http_script.c +@@ -1202,6 +1202,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.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -5,6 +5,7 @@ SRC_URI:append = " \ file://CVE-2026-42934.patch \ file://CVE-2026-42946_p1.patch \ file://CVE-2026-42946_p2.patch \ + file://CVE-2026-42945.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -5,6 +5,7 @@ SRC_URI:append = " \ file://CVE-2026-42934.patch \ file://CVE-2026-42946_p1.patch \ file://CVE-2026-42946_p2.patch \ + file://CVE-2026-42945.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 5/11 nginx: fix CVE-2026-9256
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/3f135ae2eb60ce376196c898a6c7cb4d774f7068
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-9256.patch | 77 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 3 files changed, 79 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-9256.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-9256.patch new file +77 -0
@@ -0,0 +1,77 @@ +From 3f135ae2eb60ce376196c898a6c7cb4d774f7068 Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan <[email protected]> +Date: Thu, 14 May 2026 18:42:18 +0400 +Subject: [PATCH] Rewrite: fix buffer overflow with overlapping captures + +When the rewrite replacement string had no variables, but had +overlapping captures, the length of the allocated buffer could be +smaller than the replacement string. This could happen either +when the "redirect" parameter is specified, or when arguments are +present in the replacement string. + +The following configurations resulted in heap buffer overflow when +using URI "/++++++++++++++++++++++++++++++": + + location / { + rewrite ^/((.*))$ http://127.0.0.1:8080/$1$2 redirect; + return 200 foo; + } + + location / { + rewrite ^/((.*))$ http://127.0.0.1:8080/?$1$2; + return 200 foo; + } + +Reported by Mufeed VH of Winfunc Research. + +CVE: CVE-2026-9256 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/3f135ae2eb60ce376196c898a6c7cb4d774f7068] + +(cherry picked from commit 3f135ae2eb60ce376196c898a6c7cb4d774f7068) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/ngx_http_script.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c +index 2ea611373..8a28e23a6 100644 +--- a/src/http/ngx_http_script.c ++++ b/src/http/ngx_http_script.c +@@ -1037,6 +1037,8 @@ ngx_http_script_start_args_code(ngx_http_script_engine_t *e) + void + ngx_http_script_regex_start_code(ngx_http_script_engine_t *e) + { ++ int *cap; ++ u_char *p; + size_t len; + ngx_int_t rc; + ngx_uint_t n; +@@ -1143,15 +1145,19 @@ ngx_http_script_regex_start_code(ngx_http_script_engine_t *e) + if (code->lengths == NULL) { + e->buf.len = code->size; + +- if (code->uri) { +- if (r->ncaptures && (r->quoted_uri || r->plus_in_uri)) { +- e->buf.len += 2 * ngx_escape_uri(NULL, r->uri.data, r->uri.len, +- NGX_ESCAPE_ARGS); +- } +- } ++ cap = r->captures; ++ p = r->captures_data; + + for (n = 2; n < r->ncaptures; n += 2) { +- e->buf.len += r->captures[n + 1] - r->captures[n]; ++ e->buf.len += cap[n + 1] - cap[n]; ++ ++ if (code->uri) { ++ if (r->quoted_uri || r->plus_in_uri) { ++ e->buf.len += 2 * ngx_escape_uri(NULL, &p[cap[n]], ++ cap[n + 1] - cap[n], ++ NGX_ESCAPE_ARGS); ++ } ++ } + } + + } else { +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -6,6 +6,7 @@ SRC_URI:append = " \ file://CVE-2026-42946_p1.patch \ file://CVE-2026-42946_p2.patch \ file://CVE-2026-42945.patch \ + file://CVE-2026-9256.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -6,6 +6,7 @@ SRC_URI:append = " \ file://CVE-2026-42946_p1.patch \ file://CVE-2026-42946_p2.patch \ file://CVE-2026-42945.patch \ + file://CVE-2026-9256.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 6/11 nginx: fix CVE-2026-42055
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
Use version-specific backports: nginx 1.28.3 contains only the affected gRPC module, while nginx 1.29.7 also contains ngx_http_proxy_v2_module and therefore carries the complete upstream changes for both modules.
[1] https://github.com/nginx/nginx/commit/131be8514da8985b15b74150521afedbf9cc4ea3
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/nginx-1.28.3/CVE-2026-42055.patch | 108 ++++++++++ .../nginx/nginx-1.29.7/CVE-2026-42055.patch | 188 ++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 4 files changed, 298 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42055.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42055.patch
meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42055.patch new file +108 -0
@@ -0,0 +1,108 @@ +From 131be8514da8985b15b74150521afedbf9cc4ea3 Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan <[email protected]> +Date: Tue, 2 Jun 2026 19:37:17 +0400 +Subject: [PATCH] Upstream: limit header length for HTTP/2 and gRPC + +The change applies the HTTP/2 header length limits to avoid buffer +overflow. See 58a7bc3406ac for details. + +Reported by Mufeed VH of Winfunc Research. + +CVE: CVE-2026-42055 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/131be8514da8985b15b74150521afedbf9cc4ea3] + +Backport Changes: +- Dropped the ngx_http_proxy_v2_module.c hunk because that module is not + available in nginx 1.28.3. Retained the ngx_http_grpc_module.c fix. + +(cherry picked from commit 131be8514da8985b15b74150521afedbf9cc4ea3) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/modules/ngx_http_grpc_module.c | 44 +++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c +index 80046d6a4..84ce51265 100644 +--- a/src/http/modules/ngx_http_grpc_module.c ++++ b/src/http/modules/ngx_http_grpc_module.c +@@ -749,6 +749,12 @@ ngx_http_grpc_create_request(ngx_http_request_t *r) + tmp_len = 0; + + } else { ++ if (r->method_name.len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 method: \"%V\"", &r->method_name); ++ return NGX_ERROR; ++ } ++ + len += 1 + NGX_HTTP_V2_INT_OCTETS + r->method_name.len; + tmp_len = r->method_name.len; + } +@@ -769,6 +775,12 @@ ngx_http_grpc_create_request(ngx_http_request_t *r) + uri_len = r->uri.len + escape + sizeof("?") - 1 + r->args.len; + } + ++ if (uri_len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 URI"); ++ return NGX_ERROR; ++ } ++ + len += 1 + NGX_HTTP_V2_INT_OCTETS + uri_len; + + if (tmp_len < uri_len) { +@@ -778,6 +790,12 @@ ngx_http_grpc_create_request(ngx_http_request_t *r) + /* :authority header */ + + if (!glcf->host_set) { ++ if (ctx->host.len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 host: \"%V\"", &ctx->host); ++ return NGX_ERROR; ++ } ++ + len += 1 + NGX_HTTP_V2_INT_OCTETS + ctx->host.len; + + if (tmp_len < ctx->host.len) { +@@ -808,6 +826,18 @@ ngx_http_grpc_create_request(ngx_http_request_t *r) + continue; + } + ++ if (key_len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 header name"); ++ return NGX_ERROR; ++ } ++ ++ if (val_len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 header value"); ++ return NGX_ERROR; ++ } ++ + len += 1 + NGX_HTTP_V2_INT_OCTETS + key_len + + NGX_HTTP_V2_INT_OCTETS + val_len; + +@@ -842,6 +872,20 @@ ngx_http_grpc_create_request(ngx_http_request_t *r) + continue; + } + ++ if (header[i].key.len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 header name: \"%V\"", ++ &header[i].key); ++ return NGX_ERROR; ++ } ++ ++ if (header[i].value.len > NGX_HTTP_V2_MAX_FIELD) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too long http2 header value: \"%V: %V\"", ++ &header[i].key, &header[i].value); ++ return NGX_ERROR; ++ } ++ + len += 1 + NGX_HTTP_V2_INT_OCTETS + header[i].key.len + + NGX_HTTP_V2_INT_OCTETS + header[i].value.len; + +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42055.patch new file +188 -0
188 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -7,6 +7,7 @@ SRC_URI:append = " \ file://CVE-2026-42946_p2.patch \ file://CVE-2026-42945.patch \ file://CVE-2026-9256.patch \ + file://CVE-2026-42055.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -7,6 +7,7 @@ SRC_URI:append = " \ file://CVE-2026-42946_p2.patch \ file://CVE-2026-42945.patch \ file://CVE-2026-9256.patch \ + file://CVE-2026-42055.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 7/11 nginx: fix CVE-2026-48142
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/60c4243eb8775d51662a01def8a7dad5d9fb34a7
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-48142.patch | 42 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 3 files changed, 44 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-48142.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-48142.patch new file +42 -0
@@ -0,0 +1,42 @@ +From 60c4243eb8775d51662a01def8a7dad5d9fb34a7 Mon Sep 17 00:00:00 2001 +From: Sergey Kandaurov <[email protected]> +Date: Mon, 1 Jun 2026 21:46:48 +0400 +Subject: [PATCH] Charset: fixed another rare buffer overread in + recode_from_utf8() + +With prerequisites similar to 696a7f1b9, it was possible to gain 1-byte +overread on invalid UTF-8 sequences. The reason is ngx_utf8_decode() +stops advancing the pointer position on the first encountered invalid +byte. The fix is to adjust the advanced pointer up to the whole saved +sequence in this case. Note that this may result in different output +compared to complete invalid UTF-8 sequences, which we can disregard +at this point. + +Reported by Han Yan of Xiaomi and p4p3r of CYBERONE. + +CVE: CVE-2026-48142 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/60c4243eb8775d51662a01def8a7dad5d9fb34a7] + +(cherry picked from commit 60c4243eb8775d51662a01def8a7dad5d9fb34a7) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/modules/ngx_http_charset_filter_module.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c +index edb2db568..e0115e1e4 100644 +--- a/src/http/modules/ngx_http_charset_filter_module.c ++++ b/src/http/modules/ngx_http_charset_filter_module.c +@@ -855,6 +855,10 @@ ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0, + "http charset invalid utf 1"); + ++ if (saved < &ctx->saved[ctx->saved_len]) { ++ saved = &ctx->saved[ctx->saved_len]; ++ } ++ + } else { + dst = ngx_sprintf(dst, "&#%uD;", n); + } +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -8,6 +8,7 @@ SRC_URI:append = " \ file://CVE-2026-42945.patch \ file://CVE-2026-9256.patch \ file://CVE-2026-42055.patch \ + file://CVE-2026-48142.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -8,6 +8,7 @@ SRC_URI:append = " \ file://CVE-2026-42945.patch \ file://CVE-2026-9256.patch \ file://CVE-2026-42055.patch \ + file://CVE-2026-48142.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 8/11 nginx: fix CVE-2026-42533
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
These patches apply the upstream fix sequence as referenced in [6], using the commits shown in [1] through [5].
Use version-specific fourth patches: nginx 1.28.3 lacks ngx_http_proxy_v2_module, while the nginx 1.29.7 backport retains the applicable proxy-v2 bounds checks with its older request-body layout.
[1] https://github.com/nginx/nginx/commit/ea47fabf55e2bc9192ddc27f52486b4e58d5e007
[2] https://github.com/nginx/nginx/commit/7ac67898bdfed2140a1bedcda252074cca11f494
[3] https://github.com/nginx/nginx/commit/78950bdcd443830bde00f6844dba3033c18862b1
[4] https://github.com/nginx/nginx/commit/326b17b0038321c29252e79bf4c53d4773fcb8b5
[5] https://github.com/nginx/nginx/commit/97e40e59b7b4ad6aa36f54ce4f1e64d1e98f24cb
[6] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-42533_p1.patch | 127 +++ .../nginx/files/CVE-2026-42533_p2.patch | 381 +++++++++ .../nginx/files/CVE-2026-42533_p3.patch | 704 +++++++++++++++++ .../nginx/files/CVE-2026-42533_p5.patch | 254 ++++++ .../nginx-1.28.3/CVE-2026-42533_p4.patch | 587 ++++++++++++++ .../nginx-1.29.7/CVE-2026-42533_p4.patch | 723 ++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 5 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 5 + 8 files changed, 2786 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p1.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p2.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p3.patch create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p5.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42533_p4.patch create mode 100644 meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42533_p4.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p1.patch new file +127 -0
@@ -0,0 +1,127 @@ +From ea47fabf55e2bc9192ddc27f52486b4e58d5e007 Mon Sep 17 00:00:00 2001 +From: Maxim Dounin <[email protected]> +Date: Fri, 19 Jun 2026 22:54:19 +0300 +Subject: [PATCH] Script: simplified copy capture codes. + +Signed-off-by: Roman Arutyunyan <[email protected]> +Origin: <https://freenginx.org/hg/nginx/rev/0fd5e6155817> + +CVE: CVE-2026-42533 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/ea47fabf55e2bc9192ddc27f52486b4e58d5e007] + +(cherry picked from commit ea47fabf55e2bc9192ddc27f52486b4e58d5e007) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/ngx_http_script.c | 22 ++++++++++++---------- + src/stream/ngx_stream_script.c | 10 +++++++--- + 2 files changed, 19 insertions(+), 13 deletions(-) + +diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c +index 8a28e23a6..6b33d01dd 100644 +--- a/src/http/ngx_http_script.c ++++ b/src/http/ngx_http_script.c +@@ -1343,6 +1343,7 @@ ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e) + { + int *cap; + u_char *p; ++ size_t len; + ngx_uint_t n; + ngx_http_request_t *r; + ngx_http_script_copy_capture_code_t *code; +@@ -1358,17 +1359,17 @@ ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e) + if (n < r->ncaptures) { + + cap = r->captures; ++ len = cap[n + 1] - cap[n]; + + if ((e->is_args || e->quote) + && (e->request->quoted_uri || e->request->plus_in_uri)) + { +- p = r->captures_data; ++ p = r->captures_data + cap[n]; ++ ++ return len + 2 * ngx_escape_uri(NULL, p, len, NGX_ESCAPE_ARGS); + +- return cap[n + 1] - cap[n] +- + 2 * ngx_escape_uri(NULL, &p[cap[n]], cap[n + 1] - cap[n], +- NGX_ESCAPE_ARGS); + } else { +- return cap[n + 1] - cap[n]; ++ return len; + } + } + +@@ -1381,6 +1382,7 @@ ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e) + { + int *cap; + u_char *p, *pos; ++ size_t len; + ngx_uint_t n; + ngx_http_request_t *r; + ngx_http_script_copy_capture_code_t *code; +@@ -1398,16 +1400,16 @@ ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e) + if (n < r->ncaptures) { + + cap = r->captures; +- p = r->captures_data; ++ len = cap[n + 1] - cap[n]; ++ p = r->captures_data + cap[n]; + + if ((e->is_args || e->quote) + && (e->request->quoted_uri || e->request->plus_in_uri)) + { +- e->pos = (u_char *) ngx_escape_uri(pos, &p[cap[n]], +- cap[n + 1] - cap[n], +- NGX_ESCAPE_ARGS); ++ e->pos = (u_char *) ngx_escape_uri(pos, p, len, NGX_ESCAPE_ARGS); ++ + } else { +- e->pos = ngx_copy(pos, &p[cap[n]], cap[n + 1] - cap[n]); ++ e->pos = ngx_copy(pos, p, len); + } + } + +diff --git a/src/stream/ngx_stream_script.c b/src/stream/ngx_stream_script.c +index c447e152f..2cd8b08c7 100644 +--- a/src/stream/ngx_stream_script.c ++++ b/src/stream/ngx_stream_script.c +@@ -894,6 +894,7 @@ size_t + ngx_stream_script_copy_capture_len_code(ngx_stream_script_engine_t *e) + { + int *cap; ++ size_t len; + ngx_uint_t n; + ngx_stream_session_t *s; + ngx_stream_script_copy_capture_code_t *code; +@@ -908,7 +909,8 @@ ngx_stream_script_copy_capture_len_code(ngx_stream_script_engine_t *e) + + if (n < s->ncaptures) { + cap = s->captures; +- return cap[n + 1] - cap[n]; ++ len = cap[n + 1] - cap[n]; ++ return len; + } + + return 0; +@@ -920,6 +922,7 @@ ngx_stream_script_copy_capture_code(ngx_stream_script_engine_t *e) + { + int *cap; + u_char *p, *pos; ++ size_t len; + ngx_uint_t n; + ngx_stream_session_t *s; + ngx_stream_script_copy_capture_code_t *code; +@@ -936,8 +939,9 @@ ngx_stream_script_copy_capture_code(ngx_stream_script_engine_t *e) + + if (n < s->ncaptures) { + cap = s->captures; +- p = s->captures_data; +- e->pos = ngx_copy(pos, &p[cap[n]], cap[n + 1] - cap[n]); ++ len = cap[n + 1] - cap[n]; ++ p = s->captures_data + cap[n]; ++ e->pos = ngx_copy(pos, p, len); + } + + ngx_log_debug2(NGX_LOG_DEBUG_STREAM, e->session->connection->log, 0, +-- +2.35.6
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p2.patch new file +381 -0
381 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p3.patch new file +704 -0
704 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/files/CVE-2026-42533_p5.patch new file +254 -0
254 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx-1.28.3/CVE-2026-42533_p4.patch new file +587 -0
587 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx-1.29.7/CVE-2026-42533_p4.patch new file +723 -0
723 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +5 -0
@@ -9,6 +9,11 @@ SRC_URI:append = " \ file://CVE-2026-9256.patch \ file://CVE-2026-42055.patch \ file://CVE-2026-48142.patch \ + file://CVE-2026-42533_p1.patch \ + file://CVE-2026-42533_p2.patch \ + file://CVE-2026-42533_p3.patch \ + file://CVE-2026-42533_p4.patch \ + file://CVE-2026-42533_p5.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +5 -0
@@ -9,6 +9,11 @@ SRC_URI:append = " \ file://CVE-2026-9256.patch \ file://CVE-2026-42055.patch \ file://CVE-2026-48142.patch \ + file://CVE-2026-42533_p1.patch \ + file://CVE-2026-42533_p2.patch \ + file://CVE-2026-42533_p3.patch \ + file://CVE-2026-42533_p4.patch \ + file://CVE-2026-42533_p5.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 9/11 nginx: fix CVE-2026-56434
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/nginx/nginx/commit/ddde692db11ab8238e9ca661007f64c9f6d764d2
[2] https://nginx.org/en/security_advisories.html
--- .../nginx/files/CVE-2026-56434.patch | 71 +++++++++++++++++++ .../recipes-httpd/nginx/nginx_1.28.3.bb | 1 + .../recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 3 files changed, 73 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-56434.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-56434.patch new file +71 -0
@@ -0,0 +1,71 @@ +From ddde692db11ab8238e9ca661007f64c9f6d764d2 Mon Sep 17 00:00:00 2001 +From: Roman Arutyunyan <[email protected]> +Date: Mon, 29 Jun 2026 21:49:27 +0400 +Subject: [PATCH] Avoid duplicate subrequest finalization + +Previously, if a subrequest was posted twice, it could be finalized in +both calls, excessively reducing r->main->count and potentially leading +to a use-after-free. + +The fix is to avoid posting a request if it's already posted. Also, +as a hardening measure, r->write_event_handler is now reset to a no-op +handler during active subrequest finalization. + +The problem manifests itself in ngx_http_ssi_filter_module during +unbuffered proxying. If a subrequest is created for an SSI include +statement while the main request has some data postponed by another +include, this subrequest becomes double-posted when the main request +data is flushed. The first post comes from ngx_http_subrequest() and +the second one comes from ngx_http_postpone_filter(). In case of a +quick subrequest finalization, the above mentioned problem happens. + +Reported by P4P3R-HAK. + +CVE: CVE-2026-56434 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/ddde692db11ab8238e9ca661007f64c9f6d764d2] + +(cherry picked from commit ddde692db11ab8238e9ca661007f64c9f6d764d2) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + src/http/ngx_http_request.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c +index ceac8d307..6dc275757 100644 +--- a/src/http/ngx_http_request.c ++++ b/src/http/ngx_http_request.c +@@ -2501,6 +2501,14 @@ ngx_http_post_request(ngx_http_request_t *r, ngx_http_posted_request_t *pr) + { + ngx_http_posted_request_t **p; + ++ for (p = &r->main->posted_requests; *p; p = &(*p)->next) { ++ if ((*p)->request == r) { ++ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http request already posted"); ++ return NGX_OK; ++ } ++ } ++ + if (pr == NULL) { + pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t)); + if (pr == NULL) { +@@ -2511,8 +2519,6 @@ ngx_http_post_request(ngx_http_request_t *r, ngx_http_posted_request_t *pr) + pr->request = r; + pr->next = NULL; + +- for (p = &r->main->posted_requests; *p; p = &(*p)->next) { /* void */ } +- + *p = pr; + + return NGX_OK; +@@ -2632,6 +2638,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) + + r->main->count--; + ++ r->write_event_handler = ngx_http_request_empty_handler; ++ + if (pr->postponed && pr->postponed->request == r) { + pr->postponed = pr->postponed->next; + } +-- +2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -14,6 +14,7 @@ SRC_URI:append = " \ file://CVE-2026-42533_p3.patch \ file://CVE-2026-42533_p4.patch \ file://CVE-2026-42533_p5.patch \ + file://CVE-2026-56434.patch \ " LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -14,6 +14,7 @@ SRC_URI:append = " \ file://CVE-2026-42533_p3.patch \ file://CVE-2026-42533_p4.patch \ file://CVE-2026-42533_p5.patch \ + file://CVE-2026-56434.patch \ " # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
PATCH 10/11 nginx: Ignore CVE-2026-40460
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
Analysis:
- CVE-2026-40460 affects nginx only when the HTTP/3
QUIC module is enabled [1].
- The module requires the explicit --with-http_v3_module configure option, which neither Wrynose nginx recipe enables by default [2].
- Mark the CVE not applicable only when that option is absent; report it as unpatched when a bbappend enables the module.
Reference:
[1] https://nginx.org/en/security_advisories.html
[2] https://nginx.org/en/docs/configure.html
--- meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb | 1 + meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 2 files changed, 2 insertions(+)
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -23,3 +23,4 @@ SRC_URI[sha256sum] = "2c96a946bfb0882a21744ed429770a2123ae1828c7c48665092993ddee CVE_STATUS[CVE-2025-53859] = "cpe-stable-backport: Fix is included in 1.28.1" CVE_STATUS[CVE-2026-1642] = "fixed-version: fixed since v1.28.2" +CVE_STATUS[CVE-2026-40460] = "${@ 'unpatched' if '--with-http_v3_module' in ((d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_v3_module is not enabled'}"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -25,3 +25,4 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=79da1c70d587d3a199af9255ad393f99" SRC_URI[sha256sum] = "673f8fb8c0961c44fbd9410d6161831453609b44063d3f2948253fc2b5692139" +CVE_STATUS[CVE-2026-40460] = "${@ 'unpatched' if '--with-http_v3_module' in ((d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_v3_module is not enabled'}"
Signature · 1 line
2.35.6
PATCH 11/11 nginx: Ignore CVE-2026-60005
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
Analysis:
- CVE-2026-60005 affects the optional ngx_http_slice_module [1].
- The slice module is not built by default and requires the explicit --with-http_slice_module configure option, which neither Wrynose nginx recipe enables by default [1][2].
- Mark the CVE not applicable only when that option is absent; report it as unpatched when a bbappend enables the module.
Reference:
[1] https://github.com/advisories/GHSA-vxcv-h5wj-jxr5
[2] https://nginx.org/en/docs/configure.html
--- meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb | 1 + meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb | 1 + 2 files changed, 2 insertions(+)
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
@@ -24,3 +24,4 @@ SRC_URI[sha256sum] = "2c96a946bfb0882a21744ed429770a2123ae1828c7c48665092993ddee CVE_STATUS[CVE-2025-53859] = "cpe-stable-backport: Fix is included in 1.28.1" CVE_STATUS[CVE-2026-1642] = "fixed-version: fixed since v1.28.2" CVE_STATUS[CVE-2026-40460] = "${@ 'unpatched' if '--with-http_v3_module' in ((d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_v3_module is not enabled'}" +CVE_STATUS[CVE-2026-60005] = "${@ 'unpatched' if '--with-http_slice_module' in ( (d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_slice_module is not enabled' }"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
@@ -26,3 +26,4 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=79da1c70d587d3a199af9255ad393f99" SRC_URI[sha256sum] = "673f8fb8c0961c44fbd9410d6161831453609b44063d3f2948253fc2b5692139" CVE_STATUS[CVE-2026-40460] = "${@ 'unpatched' if '--with-http_v3_module' in ((d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_v3_module is not enabled'}" +CVE_STATUS[CVE-2026-60005] = "${@ 'unpatched' if '--with-http_slice_module' in ( (d.getVar('EXTRA_OECONF') or '').split() + (d.getVar('PACKAGECONFIG_CONFARGS') or '').split()) else 'not-applicable-config: ngx_http_slice_module is not enabled' }"
Signature · 1 line
2.35.6