From 8743e36a454c9aba1ade51b26b13bbc24f38d312 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 27 Sep 2019 23:30:54 +0200 Subject: [PATCH] bump golang 1.12.10 (CVE-2019-16276) full diff: https://github.com/golang/go/compare/go1.12.9...go1.12.10 ``` Hi gophers, We have just released Go 1.13.1 and Go 1.12.10 to address a recently reported security issue. We recommend that all affected users update to one of these releases (if you're not sure which, choose Go 1.13.1). net/http (through net/textproto) used to accept and normalize invalid HTTP/1.1 headers with a space before the colon, in violation of RFC 7230. If a Go server is used behind an uncommon reverse proxy that accepts and forwards but doesn't normalize such invalid headers, the reverse proxy and the server can interpret the headers differently. This can lead to filter bypasses or request smuggling, the latter if requests from separate clients are multiplexed onto the same upstream connection by the proxy. Such invalid headers are now rejected by Go servers, and passed without normalization to Go client applications. The issue is CVE-2019-16276 and Go issue golang.org/issue/34540. Thanks to Andrew Stucki, Adam Scarr (99designs.com), and Jan Masarik (masarik.sh) for discovering and reporting this issue. Downloads are available at https://golang.org/dl for all supported platforms. Alla prossima, Filippo on behalf of the Go team ``` From the patch: https://github.com/golang/go/commit/6e6f4aaf70c8b1cc81e65a26332aa9409de03ad8 ``` net/textproto: don't normalize headers with spaces before the colon RFC 7230 is clear about headers with a space before the colon, like X-Answer : 42 being invalid, but we've been accepting and normalizing them for compatibility purposes since CL 5690059 in 2012. On the client side, this is harmless and indeed most browsers behave the same to this day. On the server side, this becomes a security issue when the behavior doesn't match that of a reverse proxy sitting in front of the server. For example, if a WAF accepts them without normalizing them, it might be possible to bypass its filters, because the Go server would interpret the header differently. Worse, if the reverse proxy coalesces requests onto a single HTTP/1.1 connection to a Go server, the understanding of the request boundaries can get out of sync between them, allowing an attacker to tack an arbitrary method and path onto a request by other clients, including authentication headers unknown to the attacker. This was recently presented at multiple security conferences: https://portswigger.net/blog/http-desync-attacks-request-smuggling-reborn net/http servers already reject header keys with invalid characters. Simply stop normalizing extra spaces in net/textproto, let it return them unchanged like it does for other invalid headers, and let net/http enforce RFC 7230, which is HTTP specific. This loses us normalization on the client side, but there's no right answer on the client side anyway, and hiding the issue sounds worse than letting the application decide. ``` Signed-off-by: Sebastiaan van Stijn --- appveyor.yml | 2 +- dockerfiles/Dockerfile.binary-native | 2 +- dockerfiles/Dockerfile.cross | 2 +- dockerfiles/Dockerfile.dev | 2 +- dockerfiles/Dockerfile.e2e | 2 +- dockerfiles/Dockerfile.lint | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 70b3147e98..c117563fda 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ clone_folder: c:\gopath\src\github.com\docker\cli environment: GOPATH: c:\gopath - GOVERSION: 1.12.9 + GOVERSION: 1.12.10 DEPVERSION: v0.4.1 install: diff --git a/dockerfiles/Dockerfile.binary-native b/dockerfiles/Dockerfile.binary-native index 0424765568..86b402e145 100644 --- a/dockerfiles/Dockerfile.binary-native +++ b/dockerfiles/Dockerfile.binary-native @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.12.10 FROM golang:${GO_VERSION}-alpine diff --git a/dockerfiles/Dockerfile.cross b/dockerfiles/Dockerfile.cross index ebf64d4441..696f03f30e 100644 --- a/dockerfiles/Dockerfile.cross +++ b/dockerfiles/Dockerfile.cross @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.12.10 FROM dockercore/golang-cross:${GO_VERSION} ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 diff --git a/dockerfiles/Dockerfile.dev b/dockerfiles/Dockerfile.dev index 0ecd1af369..4d336f5f53 100644 --- a/dockerfiles/Dockerfile.dev +++ b/dockerfiles/Dockerfile.dev @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.12.10 FROM golang:${GO_VERSION}-alpine diff --git a/dockerfiles/Dockerfile.e2e b/dockerfiles/Dockerfile.e2e index 564320bf9f..e7a23a8286 100644 --- a/dockerfiles/Dockerfile.e2e +++ b/dockerfiles/Dockerfile.e2e @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.12.10 # Use Debian based image as docker-compose requires glibc. FROM golang:${GO_VERSION} diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index c4fdfa495f..ac9b5442f6 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.9 +ARG GO_VERSION=1.12.10 FROM golang:${GO_VERSION}-alpine