]> dgit.raspbian.org Git - haproxy.git/commit
[PATCH] 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)
committerVincent Bernat <bernat@debian.org>
Sat, 17 Oct 2026 17:17:39 +0000 (19:17 +0200)
commitd441b988cc37e6ffc5151aa47af3041144e3390e
tree1af4e68fb269dc2f5f3714bd962159b753fc2f5b
parentade9633ef7d2c70c75f187d8ffc061e91f77bd80
[PATCH] 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)
[cf: VTC slightly adapted for 2.6]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
Gbp-Pq: Name 0001-BUG-MAJOR-h1-htx-report-an-error-on-a-too-long-chunk.patch
reg-tests/http-messaging/h1_big_chunk_size_line.vtc [new file with mode: 0644]
src/h1_htx.c