]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.7] net/http, net/http/cgi: fix for CGI + HTTP_PROXY security...
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 18 Jul 2016 06:05:24 +0000 (06:05 +0000)
committerChris Broadfoot <cbro@golang.org>
Mon, 18 Jul 2016 15:13:06 +0000 (15:13 +0000)
commitcad4e97af8f2e0b9f09b97f67fb3a89ced2e9021
treefb24b2f2ebc41e265ea34f318d6dfe6fcd525651
parent53da5fd4d431881bb3583c9790db7735a6530a1b
[release-branch.go1.7] net/http, net/http/cgi: fix for CGI + HTTP_PROXY security issue

Because,

* The CGI spec defines that incoming request header "Foo: Bar" maps to
  environment variable HTTP_FOO == "Bar". (see RFC 3875 4.1.18)

* The HTTP_PROXY environment variable is conventionally used to configure
  the HTTP proxy for HTTP clients (and is respected by default for
  Go's net/http.Client and Transport)

That means Go programs running in a CGI environment (as a child
process under a CGI host) are vulnerable to an incoming request
containing "Proxy: attacker.com:1234", setting HTTP_PROXY, and
changing where Go by default proxies all outbound HTTP requests.

This is CVE-2016-5386, aka https://httpoxy.org/

Fixes #16405

Change-Id: I6f68ade85421b4807785799f6d98a8b077e871f0
Reviewed-on: https://go-review.googlesource.com/25010
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-on: https://go-review.googlesource.com/25013
src/net/http/cgi/host.go
src/net/http/cgi/host_test.go
src/net/http/transport.go
src/net/http/transport_test.go