Skip to content

Reject a Host header with a path, a query or a fragment - #1949

Merged
uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:host-no-path
Oct 2, 2026
Merged

uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:host-no-path

Conversation

@nigrosimone

Copy link
Copy Markdown
Contributor

Http11Probe COMP-HOST-WITH-PATH sends Host: localhost:8080/path and gets 200. RFC 9112 3.2 says a Host with an invalid value MUST get a 400, and an authority ends at the first /, ? or # (RFC 3986 3.2).

The fix adds these three characters to isInvalidHost. gcc compiles the check to one bit test, so the loop does not get longer.

The new test in tests/HttpParser.cpp sends the three hosts, it fails without the fix.

With Http11Probe locally only COMP-HOST-WITH-PATH moves, from Fail to Pass.

@nigrosimone
nigrosimone marked this pull request as ready for review October 2, 2026 06:08
@uNetworkingAB
uNetworkingAB merged commit 4aecb9b into uNetworking:master Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants