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
* Rebuilt URL to: localhost:8080/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: victim.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 21 Feb 2018 10:17:55 GMT
< Content-Length: 11
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
Hello World%
What did you expect to see?
Either the request to fail or the documentation for ListenAndServe or Handler to say that the local listener does not check for the Host header and is thus vulnerable to DNS rebinding attacks.
What did you see instead?
The request obtaining a response, without checks on the host header, and without any documentation on this issue.
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
http.ListenAndServe is vulnerable to DNS rebinding attacks
net/http: ListenAndServe is vulnerable to DNS rebinding attacks
Feb 21, 2018
Depending on the confirmation and severity of the issue after we evaluate it, perhaps in the future, please report security issues first to security@golang.org as detailed at https://golang.org/security, but either way, thank you for reporting it!
What version of Go are you using (
go version
)?go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I wrote this small sample http listener code:
This, as expected, only listens for loopback connections, and it does not respond to requests coming from outside the machine.
I then tried, from the local host, to perform a request with an arbitrary Host header:
curl localhost:8080 --verbose --header "Host: victim.com"
What did you expect to see?
Either the request to fail or the documentation for ListenAndServe or Handler to say that the local listener does not check for the Host header and is thus vulnerable to DNS rebinding attacks.
What did you see instead?
The request obtaining a response, without checks on the host header, and without any documentation on this issue.
The text was updated successfully, but these errors were encountered: