]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: h1-htx: report an error on a too long chunk-size line
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Oct 2026 13:34:58 +0000 (15:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 14 Oct 2026 14:01:07 +0000 (16:01 +0200)
commit2e4ba6a570809bcfb4e2ba04948e64e5d07622b3
tree783f7f7ac35061937f04871d4dd0ac2ec5449b13
parenteeafce8ea9589acd1596a83bdb401008ad71f216
BUG/MAJOR: h1-htx: report an error on a too long chunk-size line

When a chunked message starts with a chunk-size line longer than the input
buffer, the parser was looping forever: the line was never complete, no data
could be consumed, and the connection remained stuck until the client
timeout because the buffer was full and could not be extended.

The full-buffer detection used for too large headers and trailers is now
also applied to the chunk-size line: if nothing was parsed and the input
buffer is full, the line cannot possibly fit and a parsing error is reported
instead of waiting for more data that will never fit.

A workaround consists to reject chunk-encoded request:

    http-request reject if { req.hdr(transfer-encoding) -i chunked }

This should be backported at least to 3.0. But possibly to all stable
versions with some modifications. However, no loop can be experienced on 2.8
and 2.6.

Many thanks to Adam Crawford for the report and the fix.

(cherry picked from commit 6e495dbb2a4850578439cf795966c068c1bdffe3)
Signed-off-by: Willy Tarreau <w@1wt.eu>
reg-tests/http-messaging/h1_big_chunk_size_line.vtc [new file with mode: 0644]
src/h1_htx.c