• Brad Fitzpatrick's avatar
    net/http, net/http/cgi: fix for CGI + HTTP_PROXY security issue · b97df54c
    Brad Fitzpatrick authored
    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: 's avatarChris Broadfoot <cbro@golang.org>
    b97df54c
Name
Last commit
Last update
..
cgi Loading commit data...
cookiejar Loading commit data...
fcgi Loading commit data...
httptest Loading commit data...
httptrace Loading commit data...
httputil Loading commit data...
internal Loading commit data...
pprof Loading commit data...
testdata Loading commit data...
client.go Loading commit data...
client_test.go Loading commit data...
clientserver_test.go Loading commit data...
cookie.go Loading commit data...
cookie_test.go Loading commit data...
doc.go Loading commit data...
example_test.go Loading commit data...
export_test.go Loading commit data...
filetransport.go Loading commit data...
filetransport_test.go Loading commit data...
fs.go Loading commit data...
fs_test.go Loading commit data...
h2_bundle.go Loading commit data...
header.go Loading commit data...
header_test.go Loading commit data...
http.go Loading commit data...
http_test.go Loading commit data...
jar.go Loading commit data...
main_test.go Loading commit data...
method.go Loading commit data...
npn_test.go Loading commit data...
proxy_test.go Loading commit data...
race.go Loading commit data...
range_test.go Loading commit data...
readrequest_test.go Loading commit data...
request.go Loading commit data...
request_test.go Loading commit data...
requestwrite_test.go Loading commit data...
response.go Loading commit data...
response_test.go Loading commit data...
responsewrite_test.go Loading commit data...
serve_test.go Loading commit data...
server.go Loading commit data...
sniff.go Loading commit data...
sniff_test.go Loading commit data...
status.go Loading commit data...
transfer.go Loading commit data...
transfer_test.go Loading commit data...
transport.go Loading commit data...
transport_internal_test.go Loading commit data...
transport_test.go Loading commit data...
triv.go Loading commit data...