BUG/MEDIUM: h3: Properly limit the number of headers received
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Nov 2024 16:20:05 +0000 (17:20 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Nov 2024 14:47:00 +0000 (15:47 +0100)
commit97f2c2e56eb8d22b8181253968733e9b80d6cbae
treea0eafd77bfa4eda7100046c591e3fb32cb65e91a
parent0777b7dded26b3584a5b05fa93867224371750c5
BUG/MEDIUM: h3: Properly limit the number of headers received

The number of headers are limited before the decoding but pseudo headers and
cookie headers consume extra slots. In practice, this lowers the maximum number
of headers that can be received.

To workaround this issue, the limit is doubled during the frame decoding to be
sure to have enough extra slots. And the number of headers is tested against the
configured limit after the HTX message was created to be able to report an
error. Unfortunatly no parsing error are reported because the QUIC multiplexer
is not able to do so for now.

The same is performed on trailers to be consistent with H2.

This patch should be backported as far as 2.6.

(cherry picked from commit 785e63335374a6db8ef35205cdb36ea726710061)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/h3.c