https://github.com/cilium/cilium
Revision a3d58a4b32ab3fa65146154065a50289ae185c3e authored by Tobias Klauser on 13 July 2023, 08:26:42 UTC, committed by Sebastian Wicki on 19 July 2023, 14:13:57 UTC
[ upstream commit b9ec2aaece578278733e473a72bb5594f621d495 ]

Go 1.20.6 added a security fix [1] which leads to stricter sanitization
of the HTTP host header in the net/http client. Cilium's pkg/client
currently sets the Host header to the UDS path (e.g.
/var/run/cilium/cilium.sock), however the slashes in that Host header
now lead net/http to reject it.

RFC 7230, Section 5.4 states [2]:

> If the authority component is missing or undefined for the target URI,
> then a client MUST send a Host header field with an empty field-value.

The authority component is undefined for the unix:// scheme. Thus, the
correct value to use would be the empty string. However, this does not
work due to OpenAPI runtime using the same value for the URL's host and
the http client's host header. Thus, use a dummy value "localhost".

[1] https://go.dev/issue/60374
[2] https://datatracker.ietf.org/doc/html/rfc7230#section-5.4

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
1 parent 4fa7df8
History
Tip revision: a3d58a4b32ab3fa65146154065a50289ae185c3e authored by Tobias Klauser on 13 July 2023, 08:26:42 UTC
client, health/client: set dummy host header on unix:// local communication
Tip revision: a3d58a4
File Mode Size
.github
.travis
Documentation
api
bpf
bugtool
cilium
cilium-health
clustermesh-apiserver
contrib
daemon
envoy
examples
hack
hubble-relay
images
install
jenkinsfiles
operator
pkg
plugins
proxylib
test
tools
vendor
.authors.aux -rw-r--r-- 416 bytes
.gitattributes -rw-r--r-- 301 bytes
.gitignore -rw-r--r-- 1.5 KB
.gitmodules -rw-r--r-- 0 bytes
.golangci.yaml -rw-r--r-- 3.3 KB
.mailmap -rw-r--r-- 5.0 KB
.travis.yml -rw-r--r-- 1.2 KB
AUTHORS -rw-r--r-- 26.3 KB
CHANGELOG.md -rw-r--r-- 156.1 KB
CODEOWNERS -rw-r--r-- 1.2 KB
CODE_OF_CONDUCT.md -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 227 bytes
FURTHER_READINGS.rst -rw-r--r-- 4.9 KB
GO_VERSION -rw-r--r-- 8 bytes
LICENSE -rw-r--r-- 11.1 KB
MAINTAINERS.md -rw-r--r-- 3.8 KB
Makefile -rw-r--r-- 29.1 KB
Makefile.defs -rw-r--r-- 6.0 KB
Makefile.docker -rw-r--r-- 6.3 KB
Makefile.quiet -rw-r--r-- 788 bytes
README.rst -rw-r--r-- 15.0 KB
SECURITY.md -rw-r--r-- 615 bytes
USERS.md -rw-r--r-- 8.1 KB
VERSION -rw-r--r-- 8 bytes
Vagrantfile -rw-r--r-- 12.9 KB
go.mod -rw-r--r-- 10.9 KB
go.sum -rw-r--r-- 206.7 KB
netlify.toml -rw-r--r-- 92 bytes
stable.txt -rw-r--r-- 8 bytes
vagrant_box_defaults.rb -rw-r--r-- 394 bytes

README.rst

back to top