BUG/MAJOR: mux-h2: Report a protocol error for any DATA frame before headers
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Sep 2023 14:21:58 +0000 (16:21 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 14 Sep 2023 09:39:39 +0000 (11:39 +0200)
commit89e20033c78b7d93f0b75f91d61fa78eef67440d
treebd3871068b1cf758c08e7b222198e92ff3a2a26a
parente3b2704e26a32bb67f4921193acef167962cf5db
BUG/MAJOR: mux-h2: Report a protocol error for any DATA frame before headers

If any DATA frame is received before all headers are fully received, a
protocol error must be reported. It is required by the HTTP/2 RFC but it is
also important because the HTTP analyzers expect the first HTX block is a
start-line. It leads to a crash if this statement is not respected.

For instance, it is possible to trigger a crash by sending an interim
message with a DATA frame (It may be an empty DATA frame with the ES
flag). AFAIK, only the server side is affected by this bug.

To fix the issue, an protocol error is reported for the stream.

This patch should fix the issue #2291. It must be backported as far as 2.2
(and probably to 2.0 too).
src/mux_h2.c