BUG/MEDIUM: mux-h2: Check the number of headers in HEADERS frame after decoding
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Nov 2024 15:27:34 +0000 (16:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Nov 2024 16:44:22 +0000 (17:44 +0100)
commit63d2760dfa679bea4b7a61a1a8702af23cf26e75
tree66eb3fb7c1d43ce23f0f85f1c1ae0018b022a156
parente415e3cb7aa1feaac3ed703687656e09dd464eb3
BUG/MEDIUM: mux-h2: Check the number of headers in HEADERS frame after decoding

There is no explicit test on the number of headers when a HEADERS frame is
received. It is implicitely limited by the size of the header list. But it
is twice the configured limit to be sure to decode the frame.

So now, a check is performed after the HTX message was created. This way, we
are sure to not exceed the configured limit after the decoding stage. If
there are too many headers, a parsing error is reported.

Note the same is performed on the trailers.

This patch should patially address the issue #2685. It should be backported
to all stable versions.
src/h2.c
src/mux_h2.c