You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I may find some bugs with the Host header where tornado parses HTTP requests.
RFC 9112 says this:
A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field line or a Host header field with an invalid field value.
This should imply that the HTTP server must reject requests with redundant Host headers or requests with missing Host headers. But in both cases, tornado did not reject.
Examples:
POST / HTTP/1.1\r\n
Host: victim1.com\r\n
Host: victim2.com\r\n
\r\n
Ack that we should be rejecting multiple Host headers. I'm not sure about rejecting requests with no host header - we support those for HTTP/1.0 compatibility (does that matter any more? I suppose It's simpler for the rare occasions when you type in a request by hand over telnet or something).
Maybe we should reject host headers containing commas too (which may indicate multiple header lines that were combined according to RFC 9110 section 5.2 and 5.3)? The host header is defined as uri-host which is very permissive to support different URI schemes, but for HTTP this can probably be narrowed down to DNS-legal names.
Part of the problem is that we don't require you to specify expected hostnames (hostname matching rules default to .*) and even when you specify it it's common to use unescaped . to match too much.
Hello, I may find some bugs with the
Host
header where tornado parses HTTP requests.RFC 9112 says this:
This should imply that the HTTP server must reject requests with redundant
Host
headers or requests with missingHost
headers. But in both cases, tornado did not reject.Examples:
or
The version I tested was f62afc3.
The text was updated successfully, but these errors were encountered: