]> git.kaiwu.me - nginx.git/commit
HTTP/2: account for queued frames when validating WINDOW_UPDATE
authorRoman Arutyunyan <arut@nginx.com>
Thu, 29 Oct 2026 17:37:05 +0000 (21:37 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Wed, 11 Nov 2026 12:16:37 +0000 (16:16 +0400)
commite27f5fa84fe6e98505e70bc543b748747dad0a3b
tree616bba011cf770832b2f2592d17c697945fbceb6
parente39708edc69a9c0c992b6af075db761946969534
HTTP/2: account for queued frames when validating WINDOW_UPDATE

When a stream is terminated, its unsent payload length is refunded back
to the connection flow control.  Previously, this could increase the
flow control beyond NGX_HTTP_V2_MAX_WINDOW, if it was increased by the
client after the stream frames were queued and before the stream was
terminated.  This eventually resulted in broken buffer size control in
ngx_http_v2_send_chain() followed by memory corruption and a possible
segmentation fault.

The fix is to account for the queued frames when validating a client
WINDOW_UPDATE.  From the client's point of view, the queued frames
still belong to the flow control window.

Reported by Xint.io.
src/http/v2/ngx_http_v2.c
src/http/v2/ngx_http_v2.h
src/http/v2/ngx_http_v2_filter_module.c