[PATCH 1 of 3] SSL: fixed syncing of keys with automatic ticket key rotation

Maxim Dounin mdounin at mdounin.ru
Tue Oct 27 05:41:54 UTC 2026


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1793076459 -10800
#      Tue Oct 27 07:47:39 2026 +0300
# Node ID d08712494b7af0e2611c4b5148129fd4c5bc9c50
# Parent  e4d0a072a17b87c328265855e8bb43b54956b8ea
SSL: fixed syncing of keys with automatic ticket key rotation.

Optimized rotation of session ticket keys as introduced in
8085:043006e5a0b1 (1.23.2) changed the number of keys used from 2 to 3,
but the number of keys synced from shared memory to worker processes was
not updated.  As a result, an uninitialized key was used within worker
processes, making it possible to forge a session (CVE-2026-97629).  The
fix is to sync the correct number of keys.

See also:
https://github.com/nginx/nginx/commit/1916f26e6ca49296568633d309777e36527e5bb2

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -5456,7 +5456,7 @@ ngx_ssl_rotate_ticket_keys(SSL_CTX *ssl_
     /* sync keys to the worker process memory */
 
     ngx_memcpy(keys->elts, cache->ticket_keys,
-               2 * sizeof(ngx_ssl_ticket_key_t));
+               3 * sizeof(ngx_ssl_ticket_key_t));
 
     ngx_shmtx_unlock(&shpool->mutex);
 



More information about the nginx-devel mailing list