Skip to contentSkip to conversation

nginx: Security Fix

PATCH New Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 4 messages Nov 3

lore
Share & tools
lore
#0 lore raw

cover nginx: Security Fix

From: Hetvi Thakar <[email protected]>

This series addresses CVE-2026-95101, CVE-2026-97629, and CVE-2026-15176 in the Wrynose nginx 1.28.3 and 1.29.7 recipes. The patches backport upstream fixes for HTTP/3 request-body injection, shared SSL session ticket key synchronization, and unsafe alias-based path mapping after URI rewrites.

The series is based on the eleven Nginx patches already submitted to meta-openembedded and still under review:
https://patchwork.yoctoproject.org/project/oe/cover/20261016032056.409095-1-hthakar%40cisco.com/

Those eleven patches are prerequisites; they are not included or resent in this three-patch series.

Validation: BitBake do_patch and do_compile and image build completed successfully.

Hetvi Thakar (3):
nginx: fix CVE-2026-95101
nginx: fix CVE-2026-97629
nginx: fix CVE-2026-15176

 .../nginx/files/CVE-2026-15176.patch          | 55 +++++++++++++++
 .../nginx/files/CVE-2026-95101.patch          | 69 +++++++++++++++++++
 .../nginx/files/CVE-2026-97629.patch          | 46 +++++++++++++
 .../recipes-httpd/nginx/nginx_1.28.3.bb       |  3 +
 .../recipes-httpd/nginx/nginx_1.29.7.bb       |  3 +
 5 files changed, 176 insertions(+)
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-15176.patch
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-95101.patch
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-97629.patch
Signature · 1 line
2.35.6
#1 lore raw

PATCH 1/3 nginx: fix CVE-2026-95101

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/90b30edffea4f427608c36e3849643b6f9841bc4
[2] https://ubuntu.com/security/CVE-2026-95101

---
 .../nginx/files/CVE-2026-95101.patch          | 68 +++++++++++++++++++
 .../recipes-httpd/nginx/nginx_1.28.3.bb       |  1 +
 .../recipes-httpd/nginx/nginx_1.29.7.bb       |  1 +
 3 files changed, 70 insertions(+)
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-95101.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-95101.patch new file +68 -0
new file mode 100644
index 0000000000..c70150c114
@@ -0,0 +1,68 @@
+From 90b30edffea4f427608c36e3849643b6f9841bc4 Mon Sep 17 00:00:00 2001
+From: Vadim Zhestikov <[email protected]>
+Date: Wed, 22 Jul 2026 17:48:55 -0700
+Subject: [PATCH] HTTP/3: kept the skipped frame length separate from data
+ length
+
+ngx_http_v3_parse_data() stored the remaining length of a skipped
+(unknown) frame in st->length -- the same field the request body
+filter uses for the number of DATA payload bytes to pass on as
+request body.  When an unknown frame was split across parser
+invocations, the skip was interrupted with st->length holding the
+skip remainder; on the next buffer the body filter, which calls
+the parser only while st->length == 0, treated that remainder as
+request body.
+
+When proxying, this could result in sending unframed bytes, potentially
+allowing for bypass of client_max_body_size, which is enforced only on
+the DATA path, or an injection.
+
+The fix is to keep unknown frame payload in a separate st->skip counter.
+
+Reported by Hansol Lee of GOTROOT.
+
+CVE: CVE-2026-95101
+Upstream-Status: Backport [https://github.com/nginx/nginx/commit/90b30edffea4f427608c36e3849643b6f9841bc4]
+
+Signed-off-by: Hetvi Thakar <[email protected]>
+---
+ src/http/v3/ngx_http_v3_parse.c | 4 +++-
+ src/http/v3/ngx_http_v3_parse.h | 1 +
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c
+index bcbf0dbe12..ffaade8429 100644
+--- a/src/http/v3/ngx_http_v3_parse.c
++++ b/src/http/v3/ngx_http_v3_parse.c
+@@ -1837,6 +1837,8 @@ ngx_http_v3_parse_data(ngx_connection_t *c, ngx_http_v3_parse_data_t *st,
+                            st->type, st->length);
+ 
+             if (st->type != NGX_HTTP_V3_FRAME_DATA && st->length > 0) {
++                st->skip = st->length;
++                st->length = 0;
+                 st->state = sw_skip;
+                 break;
+             }
+@@ -1846,7 +1848,7 @@ ngx_http_v3_parse_data(ngx_connection_t *c, ngx_http_v3_parse_data_t *st,
+ 
+         case sw_skip:
+ 
+-            rc = ngx_http_v3_parse_skip(b, &st->length);
++            rc = ngx_http_v3_parse_skip(b, &st->skip);
+             if (rc != NGX_DONE) {
+                 return rc;
+             }
+diff --git a/src/http/v3/ngx_http_v3_parse.h b/src/http/v3/ngx_http_v3_parse.h
+index ba004db5df..e161cecf7b 100644
+--- a/src/http/v3/ngx_http_v3_parse.h
++++ b/src/http/v3/ngx_http_v3_parse.h
+@@ -121,6 +121,7 @@ typedef struct {
+     ngx_uint_t                      state;
+     ngx_uint_t                      type;
+     ngx_uint_t                      length;
++    ngx_uint_t                      skip;
+     ngx_http_v3_parse_varlen_int_t  vlint;
+ } ngx_http_v3_parse_data_t;
+ 
+-- 
+2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
index d087ae8804..eaf069135a 100644
@@ -15,6 +15,7 @@ SRC_URI:append = " \
     file://CVE-2026-42533_p4.patch \
     file://CVE-2026-42533_p5.patch \
     file://CVE-2026-56434.patch \
+    file://CVE-2026-95101.patch \
 "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
index 3b57994069..bba4788d5e 100644
@@ -15,6 +15,7 @@ SRC_URI:append = " \
     file://CVE-2026-42533_p4.patch \
     file://CVE-2026-42533_p5.patch \
     file://CVE-2026-56434.patch \
+    file://CVE-2026-95101.patch \
 "
 
 # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
#2 lore raw

PATCH 2/3 nginx: fix CVE-2026-97629

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/fdedba031bf1ad6a80c61b1aec1418d1a87ae296
[2] https://ubuntu.com/security/CVE-2026-97629

---
 .../nginx/files/CVE-2026-97629.patch          | 45 +++++++++++++++++++
 .../recipes-httpd/nginx/nginx_1.28.3.bb       |  1 +
 .../recipes-httpd/nginx/nginx_1.29.7.bb       |  1 +
 3 files changed, 47 insertions(+)
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-97629.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-97629.patch new file +45 -0
new file mode 100644
index 0000000000..141e54bb0d
@@ -0,0 +1,45 @@
+From fdedba031bf1ad6a80c61b1aec1418d1a87ae296 Mon Sep 17 00:00:00 2001
+From: Vadim Zhestikov <[email protected]>
+Date: Wed, 22 Jul 2026 16:48:37 -0700
+Subject: [PATCH] SSL: synced all session ticket keys to the worker process
+
+The per-worker ticket key mirror is allocated with three slots
+(ngx_array_push_n(keys, 3)), matching the shared memory
+ticket_keys[3] array and the decrypt callback, which scans all
+keys->nelts slots by key name.  Key rotation, however, synced
+only two slots from shared memory, leaving the third slot's
+name, hmac_key, and aes_key uninitialized.
+
+A ticket whose key name matched the uninitialized slot (which
+holds unspecified pool memory, all zero in the best case) could
+therefore be HMAC-verified and decrypted with uninitialized key
+material, allowing a forged session.
+
+Sync all keys->nelts slots, as ngx_ssl_ticket_keys_cleanup()
+already assumes.
+
+Reported by PhiNode Labs.
+
+CVE: CVE-2026-97629
+Upstream-Status: Backport [https://github.com/nginx/nginx/commit/fdedba031bf1ad6a80c61b1aec1418d1a87ae296]
+
+Signed-off-by: Hetvi Thakar <[email protected]>
+---
+ src/event/ngx_event_openssl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
+index 1653be0c34..bb6e04313f 100644
+--- a/src/event/ngx_event_openssl.c
++++ b/src/event/ngx_event_openssl.c
+@@ -5195,7 +5195,7 @@ ngx_ssl_rotate_ticket_keys(SSL_CTX *ssl_ctx, ngx_log_t *log)
+     /* sync keys to the worker process memory */
+ 
+     ngx_memcpy(keys->elts, cache->ticket_keys,
+-               2 * sizeof(ngx_ssl_ticket_key_t));
++               keys->nelts * sizeof(ngx_ssl_ticket_key_t));
+ 
+     ngx_shmtx_unlock(&shpool->mutex);
+ 
+-- 
+2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
index eaf069135a..1ee9d41562 100644
@@ -16,6 +16,7 @@ SRC_URI:append = " \
     file://CVE-2026-42533_p5.patch \
     file://CVE-2026-56434.patch \
     file://CVE-2026-95101.patch \
+    file://CVE-2026-97629.patch \
 "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
index bba4788d5e..77b6303a74 100644
@@ -16,6 +16,7 @@ SRC_URI:append = " \
     file://CVE-2026-42533_p5.patch \
     file://CVE-2026-56434.patch \
     file://CVE-2026-95101.patch \
+    file://CVE-2026-97629.patch \
 "
 
 # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6
#3 lore raw

PATCH 3/3 nginx: fix CVE-2026-15176

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/ce1da78900b07e72f37a25f55e6606220ac45902
[2] https://ubuntu.com/security/CVE-2026-15176

---
 .../nginx/files/CVE-2026-15176.patch          | 54 +++++++++++++++++++
 .../recipes-httpd/nginx/nginx_1.28.3.bb       |  1 +
 .../recipes-httpd/nginx/nginx_1.29.7.bb       |  1 +
 3 files changed, 56 insertions(+)
 create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-15176.patch
meta-webserver/recipes-httpd/nginx/files/CVE-2026-15176.patch new file +54 -0
new file mode 100644
index 0000000000..19b9ab787d
@@ -0,0 +1,54 @@
+From ce1da78900b07e72f37a25f55e6606220ac45902 Mon Sep 17 00:00:00 2001
+From: Roman Arutyunyan <[email protected]>
+Date: Fri, 10 Jul 2026 20:10:12 +0400
+Subject: [PATCH] Avoid post-rewrite URI to path mapping with alias
+
+Previously, after a "rewrite" had changed the URI, and before a new
+location was chosen, the new URI might not match the current location
+prefix.  This becomes a problem when the location uses "alias", which
+is why normally such inconsistency is detected by checking the
+r->valid_location flag.  Meanwhile this flag only handles the
+inconsistency when using the "break" directive or parameter.  However
+in absence of those, there's still an inconsistency window from URI
+change up until the end of the current set of rewrite directives.
+URI to path mapping within this window might result in a buffer
+overflow if location's prefix was longer than the rewritten URI.
+
+The following example resulted in a buffer overflow with the request
+"/foo/1":
+
+location /foo/ {
+    alias /bar/;
+    rewrite ^/foo/.*$ /x;
+    return 200 $request_filename;
+}
+
+Alternatively, $request_filename might be used in access log format,
+"set", "if", "add_header", etc.
+
+The fix is to reject URI mapping in ngx_http_map_uri_to_path() if the
+r->uri_changed flag is set.
+
+CVE: CVE-2026-15176
+Upstream-Status: Backport [https://github.com/nginx/nginx/commit/ce1da78900b07e72f37a25f55e6606220ac45902]
+
+Signed-off-by: Hetvi Thakar <[email protected]>
+---
+ src/http/ngx_http_core_module.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
+index a5f4597294..385b84e1b3 100644
+--- a/src/http/ngx_http_core_module.c
++++ b/src/http/ngx_http_core_module.c
+@@ -1936,7 +1936,7 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
+ 
+     alias = clcf->alias;
+ 
+-    if (alias && !r->valid_location) {
++    if (alias && (!r->valid_location || r->uri_changed)) {
+         ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+                       "\"alias\" cannot be used in location \"%V\" "
+                       "where URI was rewritten", &clcf->name);
+-- 
+2.35.6
meta-webserver/recipes-httpd/nginx/nginx_1.28.3.bb +1 -0
index 1ee9d41562..5b31fabc37 100644
@@ -17,6 +17,7 @@ SRC_URI:append = " \
     file://CVE-2026-56434.patch \
     file://CVE-2026-95101.patch \
     file://CVE-2026-97629.patch \
+    file://CVE-2026-15176.patch \
 "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
meta-webserver/recipes-httpd/nginx/nginx_1.29.7.bb +1 -0
index 77b6303a74..c2a6e2b6be 100644
@@ -17,6 +17,7 @@ SRC_URI:append = " \
     file://CVE-2026-56434.patch \
     file://CVE-2026-95101.patch \
     file://CVE-2026-97629.patch \
+    file://CVE-2026-15176.patch \
 "
 
 # 1.28.x branch is the current stable branch, the recommended default
Signature · 1 line
2.35.6