Commit 2901d0c
committed
BUG/MAJOR: h3: check body size with content-length on empty FIN
In QUIC, a STREAM frame may be received with no data but with FIN bit
set. Parsing code in haproxy has changed several times to deal with it.
Now, in most of h3_rcv_buf() parsing code is skipped and the common
function qcs_http_handle_standalone_fin() is used to deal with it at the
HTX level.
However, this bypass an important HTTP/3 validation check on the
received body size if a content-length header was present. Under some
conditions, this could cause a desynchronization with the backend server
which could be exploited for request smuggling.
Fix this by using h3_check_body_size() if content-length is present when
dealing with a standalone FIN in h3_rcv_buf(). If the received body size
is incorrect, the stream is immediately resetted with H3_MESSAGE_ERROR
code and the error is forwarded to the stream layer.
Thanks to Martino Spagnuolo for his detailed report on this issue and
for having contacting us about it via the security mailing list.
This must be backported up to 2.6.1 parent 29592cb commit 2901d0c
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1754 | 1754 | | |
1755 | 1755 | | |
1756 | 1756 | | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1757 | 1765 | | |
1758 | 1766 | | |
1759 | 1767 | | |
| |||
0 commit comments