]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: h2/h3: Never insert partial headers/trailers in an HTX message
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Mar 2026 13:57:24 +0000 (14:57 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Mar 2026 06:48:02 +0000 (07:48 +0100)
commitba7dc46a92551f4ab70ea3e7fb1471d8811b5b98
tree80aee1a2bc78df5c3a44629cf681b2e7ba1f9891
parentfbdb0a991a449af0294dd09846fa4ecfda5d9f03
BUG/MINOR: h2/h3: Never insert partial headers/trailers in an HTX message

In HTX, headers and trailers parts must always be complete. It is unexpected
to found header blocks without the EOH block or trailer blocks without the
EOT block. So, during H2/H3 message parsing, we must take care to remove any
HEADER/TRAILER block inserted when an error is encountered. It is mandatory
to be sure to properly report parsing error to upper layer.x

It is now performed by calling htx_truncat_blk() function on the error
path. The tail block is saved before converting any HEADERS/TRAILERS frame
to HTX. It is used to remove all inserted block on error.

This patch rely on the following one:

  "MINOR: htx: Add function to truncate all blocks after a specific block"

It should be backported with the commit above to all stable versions for
the H2 part and as far as 2.8 for h3 one.
src/h2.c
src/h3.c