]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: hq-interop: reject too big content
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Jun 2026 08:52:49 +0000 (10:52 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Jun 2026 12:33:30 +0000 (14:33 +0200)
commit0a98fdb038d84b9626c6dfe4355874a52d1b7a8c
tree1f1e92a0b778c24339dbf99e9bf816e6d3ce476a
parent1ad74d634af3b1a6c4d0904988f3e5b3004aa834
BUG/MINOR: hq-interop: reject too big content

hq-interop request parser is minimal. It simply extracts a method and a
path until the whitespace delimiter. Parsing is interrupted if the
delimiter cannot be found, and MUX is responsible to reinvoke it later
with new content added.

This patch adjusts hq-interop parsing in case of a missing delimiter.
Now it also checks if there is space remaining in the buffer. If this is
not the case, it returns a fatal error as parsing cannot be completed at
all.

This change has the side effect of preventing a BUG_ON() crash in MUX :
in case of a truncated parsing, qcs_transfer_rx_data() may be used to
realign content from the next buffer. However this function explicitely
forbids to be called with a full buffer as it could do nothing in this
case, hence this BUG_ON() to ensure parsing is never fully blocked.

The impact of this bug remains low despite the potential BUG_ON() crash.
This is because hq-interop is only used for QUIC debugging purpose and
should not be activated in production. HTTP/3 layer is immune as it
already ensures that frame length is never bigger than a buffer size
(except for DATA frames which can be parsed in a streaming mode).

Thanks to BeaCox <root@beacox.space> for having reported us this issue.

This should be backported up to 2.6. From 3.3, qcm_stream_rx_bufsz() is
using the older "qmux" prefix and must be renamed. Also, this function
does not exists in 3.0 and older so the test must be adjusted there as
well.
src/hq_interop.c