]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: h1: Force close mode for invalid uses of T-E header
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Sep 2021 07:47:03 +0000 (09:47 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Sep 2021 14:21:25 +0000 (16:21 +0200)
commit631c7e866522f8a11c9218ffed7a95d0d6b96b5e
tree3189aedd3a40c7019a545fae40305b7d9cc0dbb3
parente136bd12a32970bc90d862d5fe09ea1952b62974
MEDIUM: h1: Force close mode for invalid uses of T-E header

Transfer-Encoding header is not supported in HTTP/1.0. However, softwares
dealing with HTTP/1.0 and HTTP/1.1 messages may accept it and transfer
it. When a Content-Length header is also provided, it must be
ignored. Unfortunately, this may lead to vulnerabilities (request smuggling
or response splitting) if an intermediary is only implementing
HTTP/1.0. Because it may ignore Transfer-Encoding header and only handle
Content-Length one.

To avoid any security issues, when Transfer-Encoding and Content-Length
headers are found in a message, the close mode is forced. The same is
performed for HTTP/1.0 message with a Transfer-Encoding header only. This
change is conform to what it is described in the last HTTP/1.1 draft. See
also httpwg/http-core#879.

Note that Content-Length header is also removed from any incoming messages
if a Transfer-Encoding header is found. However it is not true (not yet) for
responses generated by HAProxy.
src/h1.c
src/mux_h1.c