]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http: Properly reject non-HTTP/1.x protocols
authorTim Duesterhus <tim@bastelstu.be>
Mon, 9 Mar 2020 23:55:40 +0000 (00:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 May 2022 13:38:05 +0000 (15:38 +0200)
commit8f4116ea6589bcf02474622f0af4baee276e56b5
tree12895539582b7d368f9cb862608843d9b047f7d3
parent2cb3be76bf1435326984907d1fa04b6238dd0a03
BUG/MEDIUM: http: Properly reject non-HTTP/1.x protocols

This patch hardens the verification of the HTTP/1.x version line
(i.e. the first line within an HTTP/1.x request) to verify that
the protocol name within the version actually reads "HTTP".

Previously protocols that superficially resembled the wire-format
of HTTP/1.x and having a 4-letter acronym as the protocol name, such
as RTSP would pass this check.

This patch fixes GitHub issue #540, it must be backported to all
supported versions. The legacy, non-HTX parser is affected as well,
a fix must be created for it as well.

Note that such protocols can still be used when option
accept-invalid-http-request is set.
src/h1_htx.c