]> git.kaiwu.me - nginx.git/commit
HTTP/2: limit Content-Type and Location response header length
authorRoman Arutyunyan <arut@nginx.com>
Sun, 26 Apr 2026 16:20:26 +0000 (20:20 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Fri, 15 May 2026 12:23:39 +0000 (16:23 +0400)
commit58a7bc3406ac8b9dc0e0afafc69ba42df56009e3
tree68af56c931ead58d313d41ee2ca7d136b6d3c767
parent18a70a4d5806b5578d00460493954262ece55019
HTTP/2: limit Content-Type and Location response header length

Previously, when these fields were larger than ~2M, the number of bytes
allocated for the field length was insufficient for such a large number.
The deficit is 1 byte up until ~4M, 2 bytes for sizes above, and grows
bigger with even larger fields.

Currently, nginx does not have modules which allow to exploit this
overflow with reasonably large Content-Type and Location.  The reason is
other response fields make up for this deficit.  For example, the Date
header value contains the characters compressed well by Huffman
encoding, which frees up spare bytes in the header buffer.

Reported by Leo Lin.
src/http/v2/ngx_http_v2_filter_module.c