]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: reject malformed HTTP/0.9 requests
authorApollon Oikonomopoulos <apoikos@debian.org>
Sat, 5 Apr 2014 23:46:00 +0000 (02:46 +0300)
committerWilly Tarreau <w@1wt.eu>
Sun, 6 Apr 2014 05:53:07 +0000 (07:53 +0200)
commit25a15227f5d3e335202591e1b6c6bc6d99b1ec51
tree852c1e49b87edf82a2c39fbd16c769c8b7986bd4
parentb4a163a135136d5cbe20d243e2c8ddfdb0099549
BUG/MINOR: reject malformed HTTP/0.9 requests

RFC 1945 (ยง4.1) defines an HTTP/0.9 request ("Simple-Request") as:

  Simple-Request  = "GET" SP Request-URI CRLF

HAProxy tries to automatically upgrade HTTP/0.9 requests to
to HTTP/1.0, by appending "HTTP/1.0" to the request and setting the
Request-URI to "/" if it was not present. The latter however is
RFC-incompatible, as HTTP/0.9 requests must already have a Request-URI
according to the definition above. Additionally,
http_upgrade_v09_to_v10() does not check whether the request method is
indeed GET (the mandatory method for HTTP/0.9).

As a result, any single- or double-word request line is regarded as a
valid HTTP request. We fix this by failing in http_upgrade_v09_to_v10()
if the request method is not GET or the request URI is not present.
src/proto_http.c