-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default value for Host #722
Comments
|
Keep in mind that the first text is what to do when receiving a message without Host or absolute-form, whereas the other texts are requirements on generation. Yes, it is a security risk to not send Host, and I assume it would be one to provide service for an https resource without verifying that the client's request indicates one of the server's host (somehow). So, PR welcome, but the final text still needs to accept non-TLS HTTP/1.0 requests without a Host (for ass-backwards reasons). |
BTW, the reason it says SHOULD here instead of MUST is because this requirement about the ordering of fields in the header section, not about whether or not Host needs to be sent. |
|
OK, that's good. It's not a genuine problem, we just need to be clearer about generation requirements (and we might be able to carefully condition the inclusion of a default). |
The normative language in -semantics wasn't direct enough about the requirement for Host to be present in requests. There was good language in -messaging that I eventually found though, so there isn't any real problem here, just an opportunity to improve. I did this by taking the SHOULD...unless text and making that MUST unless, splitting off the SHOULD that relates to putting Host as the first field line of the header section. Also, add a note in -messaging about supplying a default value for the authority. Closes httpwg#722.
In determining the request target, the following text is included after failing to find an authority in configuration, the authority form target, or the Host header:
This is a security risk because it means that servers might not agree with clients about the identity of the resource that the request is directed to. This is especially bad as a TLS certificate is good for every port and often good for multiple names, which can mean a fairly large scope over which an attacker can exploit this confusion.
The origin form description doesn't use 2119 language, it says "A Host header field is also sent", citing -semantics. And that section is a bit weaselly in that regard, using a "SHOULD...unless".
If this were a "MUST ... unless" in -semantics, this problem would not exist (at least in theory).
Just to confuse things, the absolute-form says this, which might be read to imply that Host truly is mandatory:
The asterisk-form is the only other option that naturally lacks an authority, and that says nothing, so that might be fixed up similarly.
The text was updated successfully, but these errors were encountered: