
The master binds sockets; the workers do the work. One worker holds the event
loop, the module phases, the TLS session cache and the HTTP/3 parser — and four
of the five October bugs live in that process's memory.
Master and workers
nginx reads and validates its configuration, binds sockets, and forks workers.
The master does not serve traffic; it supervises: it respawns workers that die,
re-reads configuration on SIGHUP. Workers accept from the shared listening
sockets (accept_mutex or SO_REUSEPORT) and run the event loop.
Each worker is single-threaded for request processing. It registers descriptors
with epoll or kqueue and runs a loop: wait for readiness, run the handler,
return. aio and thread pools offload disk operations, but the request is still
owned by the event loop.
That model explains the bug shape: a long-lived process holding objects with
intertwined lifetimes. A use-after-free does not take down one request; it
corrupts the process serving hundreds.
Module phases
nginx processes a request through named phases — rewrite, find-config, access,
content, log — and modules register handlers at each. rewrite runs in the
rewrite phase and can change r->uri; the location is re-selected in
find-config on the next pass. alias is resolved in the content phase, when
ngx_http_map_uri_to_path() builds the filesystem path.
The gap between "URI changed" and "location re-selected" is the window that
CVE-2026-15176 exploits. r->valid_location catches rewrite with break or a
replacement parameter, but not a rewrite that completed normally while
something read $request_filename before the next location was chosen. The fix
adds r->uri_changed to the rejection condition:
if (alias && (!r->valid_location || r->uri_changed)) {
One line. It closes a heap overflow when the location prefix is longer than the
rewritten URI.
The TLS session cache and three key slots
TLS resumption avoids a full handshake. State lives in a shared cache
(ssl_session_cache shared:SSL:10m), and the ticket is encrypted with a ticket
key. With no static ssl_session_ticket_key file, nginx generates and rotates
keys itself.
The shared structure holds three slots: current, previous and next. Each worker
keeps a private mirror, an ngx_array_t sized with ngx_array_push_n(keys, 3)
to match. Rotation is where the bug is:
ngx_memcpy(keys->elts, cache->ticket_keys,
2 * sizeof(ngx_ssl_ticket_key_t));
Two slots copied, three allocated. The third slot's name, hmac_key and
aes_key are whatever the pool contained — zero at best, stale heap at worst. A ticket whose key name matches that slot can be HMAC-verified and
decrypted with uninitialised material. That is CVE-2026-97629, the subject of
Part 7.
HTTP/3 and the parser field
HTTP/3 runs over QUIC. nginx parses HEADERS, DATA and unknown extension frames.
ngx_http_v3_parse_data_t tracks state, type and length. The body filter
uses st->length as DATA bytes still to pass upstream.
Unknown frames are skipped using the same field. If an unknown frame arrived
split across two reads, the parser returned with the skip remainder in
st->length, and the body filter — which calls the parser only while
st->length == 0 — treated the remainder as request body on the next buffer.
Those bytes went upstream unframed.
CVE-2026-95101's fix is to give the skip its own field:
st->skip = st->length;
st->length = 0;
and to parse the skip against st->skip. Two fields, two meanings. The bug
was a type error expressed as a variable reuse.
Asynchronous I/O and the blocked counter
aio posts file operations that complete later. Each pending operation takes a
reference in r->main->blocked, an 8-bit counter. Increments were unchecked. At
256 pending operations the counter wraps to zero, and the request can be freed
while the operations still hold pointers into its pool. SSI pages with many
include virtual commands are the documented way to get there. CVE-2026-97205's
fix caps the counter at 250 (NGX_HTTP_MAX_BLOCKED) and falls back to
synchronous I/O.

Next: Part 6 — the smaller failures: alias, string evaluation, AIO and HTTP/3,
four configuration-dependent bugs with a 9.2 worst case and a very ordinary
trigger.

Comments (0)