]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h3: increment unknown request payload length
authorAndrea Cocito <andrea@cocito.eu>
Tue, 23 Jun 2026 09:44:39 +0000 (11:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Jun 2026 06:53:00 +0000 (08:53 +0200)
commit859a50a5c024d11f8d0f592d572bf35cee9fa60a
treec93bff4e1cc8f30bf9ce95c6d88207ad9ee94cc9
parent29458ba7f1ce78c55e57ebdb89543011b06b13e2
BUG/MEDIUM: h3: increment unknown request payload length

When an HTTP/3 request carries DATA frames without a Content-Length
header, the H3 mux updates the stream endpoint known input payload
length so the stream layer can pass this information to the output mux.

The current code assigns h3s->data_len to qcs->sd->kip. However,
h3s->data_len is cumulative, while sedesc->kip is an incremental value:
it is moved to the opposite side as kop and then consumed by the output
mux. With multiple DATA frames, the H1 output mux may therefore announce
chunk sizes based on the total body length received so far instead of
the next payload length.

For an H3-to-H1 request without Content-Length, this can produce
malformed chunked encoding on the backend connection. A backend HTTP/1
parser may then reject the request, and HAProxy can return a 500 to the
client.

Fix this by incrementing qcs->sd->kip with the current DATA frame length
instead of assigning the cumulative body length.

This should be backported up to 3.3.
src/h3.c