]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h1: close the connection on a short content-length
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 13 Aug 2026 18:58:18 +0000 (20:58 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 25 Aug 2026 13:52:24 +0000 (15:52 +0200)
commit75dd2c18dda29f9893574ef982ddf66de16f0408
tree655230a752040d1c28ce86500e1031c72423de5a
parent6ab73c3dc1442f8dfcfebc602270c185c5301c09
BUG/MEDIUM: mux-h1: close the connection on a short content-length

When a fixed-length message completes while curr_len is still non-zero,
fewer bytes than announced were sent and the peer keeps waiting, so
reusing the connection desynchronizes the next request (request
smuggling). In h1s_destroy(), when either the request or the response
still expects data, flag the connection on error, unless the message is
legitimately bodyless. It is then closed instead of being returned to
the idle pool.

This can be reproduced with an H2 frontend, that will send less data
than announced before sending an end of stream, to an H1 backend that
replies before it received the whole request.

This should be backported up to 2.8.

Many thanks to truff@projet7.org for reporting the issue and providing
an initial fix.
src/mux_h1.c