Skip to content

Backport of [NET-4897] net/http host header is now verified and request.host that contains socked now error into release/1.14.x#18143

Merged
jmurret merged 2 commits intorelease/1.14.xfrom
backport/jm/req-host-val/forcibly-normal-tomcat
Jul 17, 2023
Merged

Backport of [NET-4897] net/http host header is now verified and request.host that contains socked now error into release/1.14.x#18143
jmurret merged 2 commits intorelease/1.14.xfrom
backport/jm/req-host-val/forcibly-normal-tomcat

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #18129 to be assessed for backporting due to the inclusion of the label backport/1.14.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@jmurret
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

This is related to #18124 where we pinned the go versions in CI to 1.20.5 and 1.19.10.

go 1.20.6 and 1.19.11 now validate request host headers for validity, including the hostname cannot be prefixed with slashes.

For local communications (npipe://, unix://), the hostname is not used, but we need valid and meaningful hostname. Prior versions go Go would clean the host header, and strip slashes in the process, but go1.20.6 and go1.19.11 no longer do, and reject the host header. Around the community we are seeing that others are intercepting the req.host and if it starts with a slash or ends with .sock, they changing the host to localhost or another dummy value.

client: define a "dummy" hostname to use for local connections by thaJeztah · Pull Request #45942 · moby/moby

Testing & Reproduction steps

Check CI tests.

Links

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

Loading
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.

4 participants