]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: h3: check body size with content-length on empty FIN
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 Mar 2026 08:24:32 +0000 (09:24 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 Mar 2026 09:38:46 +0000 (10:38 +0100)
commit05a295441c621089ffa4318daf0dbca2dd756a84
treea7a2ea4a812ea6ab99551c4b0a160ff34a669e88
parent4e57516c9a4a9e8b6b3009626dad867bb37e2609
BUG/MAJOR: h3: check body size with content-length on empty FIN

In QUIC, a STREAM frame may be received with no data but with FIN bit
set. This situation is tedious to handle and haproxy parsing code has
changed several times to deal with this situation. Now, H3 and H09
layers parsing code are skipped in favor of the shared function
qcs_http_handle_standalone_fin() used to handle the HTX EOM emission.

However, this shortcut bypasses an important HTTP/3 validation check on
the received body size vs the announced content-length header. Under
some conditions, this could cause a desynchronization with the backend
server which could be exploited for request smuggling.

Fix HTTP/3 parsing code by adding a call to h3_check_body_size() prior
to qcs_http_handle_standalone_fin() if content-length header has been
found. If the body size is incorrect, the stream is immediately resetted
with H3_MESSAGE_ERROR code and the error is forwarded to the stream
layer.

Thanks to Martino Spagnuolo for his detailed report on this issue and
for having contacting us about it via the security mailing list.

This must be backported up to 2.6.
src/h3.c