From d122605850fca5df1ff8babe7ee9f1dfed2a335b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 14 Aug 2019 02:39:26 +0200 Subject: [PATCH 1/2] Bump golang 1.11.13 (CVE-2019-9512, CVE-2019-9514) go1.11.13 (released 2019/08/13) includes security fixes to the net/http and net/url packages. See the Go 1.11.13 milestone on our issue tracker for details: https://github.com/golang/go/issues?q=milestone%3AGo1.11.13 - net/http: Denial of Service vulnerabilities in the HTTP/2 implementation net/http and golang.org/x/net/http2 servers that accept direct connections from untrusted clients could be remotely made to allocate an unlimited amount of memory, until the program crashes. Servers will now close connections if the send queue accumulates too many control messages. The issues are CVE-2019-9512 and CVE-2019-9514, and Go issue golang.org/issue/33606. Thanks to Jonathan Looney from Netflix for discovering and reporting these issues. This is also fixed in version v0.0.0-20190813141303-74dc4d7220e7 of golang.org/x/net/http2. net/url: parsing validation issue - url.Parse would accept URLs with malformed hosts, such that the Host field could have arbitrary suffixes that would appear in neither Hostname() nor Port(), allowing authorization bypasses in certain applications. Note that URLs with invalid, not numeric ports will now return an error from url.Parse. The issue is CVE-2019-14809 and Go issue golang.org/issue/29098. Thanks to Julian Hector and Nikolai Krein from Cure53, and Adi Cohen (adico.me) for discovering and reporting this issue. Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 +- Dockerfile.e2e | 2 +- Dockerfile.simple | 2 +- Dockerfile.windows | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 121f1ed2a9d5997e4dff16313a310e82c5d8c1f2..fb4a3864f3663590497d0ab8eaa928da121efd98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ # the case. Therefore, you don't have to disable it anymore. # -ARG GO_VERSION=1.11.12 +ARG GO_VERSION=1.11.13 FROM golang:${GO_VERSION}-stretch AS base ARG APT_MIRROR diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 9a2ec32d1fba7dbd6ee6a5ab7a39eb2766b2e85d..d1c899db7d39a56bb8e3885c6b941f82d0b2a082 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.11.12 +ARG GO_VERSION=1.11.13 FROM golang:${GO_VERSION}-alpine3.9 AS builder diff --git a/Dockerfile.simple b/Dockerfile.simple index 5762742533f99a7e08e2aa6a5b625dfed8cabb7b..60a9f63880fdd2d555030fbcc41f4b6734f26bc5 100644 --- a/Dockerfile.simple +++ b/Dockerfile.simple @@ -5,7 +5,7 @@ # This represents the bare minimum required to build and test Docker. -ARG GO_VERSION=1.11.12 +ARG GO_VERSION=1.11.13 FROM golang:${GO_VERSION}-stretch diff --git a/Dockerfile.windows b/Dockerfile.windows index 6dc3a859b208b689d7d84bbbd740bc4cc00a8488..63fa2822e46dcdde471f647c5645647053a72788 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -158,7 +158,7 @@ FROM microsoft/windowsservercore # Use PowerShell as the default shell SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ARG GO_VERSION=1.11.12 +ARG GO_VERSION=1.11.13 # Environment variable notes: # - GO_VERSION must be consistent with 'Dockerfile' used by Linux. From 64c958a587ff3835d1bacc573e9db3d400dbb0ad Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 14 Aug 2019 02:51:08 +0200 Subject: [PATCH 2/2] Adjust tests for changes in Go 1.12.8 / 1.11.13 ``` 00:38:11 === Failed 00:38:11 === FAIL: opts TestParseDockerDaemonHost (0.00s) 00:38:11 hosts_test.go:87: tcp tcp:a.b.c.d address expected error "Invalid bind address format: tcp:a.b.c.d" return, got "parse tcp://tcp:a.b.c.d: invalid port \":a.b.c.d\" after host" and addr 00:38:11 hosts_test.go:87: tcp tcp:a.b.c.d/path address expected error "Invalid bind address format: tcp:a.b.c.d/path" return, got "parse tcp://tcp:a.b.c.d/path: invalid port \":a.b.c.d\" after host" and addr 00:38:11 00:38:11 === FAIL: opts TestParseTCP (0.00s) 00:38:11 hosts_test.go:129: tcp tcp:a.b.c.d address expected error Invalid bind address format: tcp:a.b.c.d return, got parse tcp://tcp:a.b.c.d: invalid port ":a.b.c.d" after host and addr 00:38:11 hosts_test.go:129: tcp tcp:a.b.c.d/path address expected error Invalid bind address format: tcp:a.b.c.d/path return, got parse tcp://tcp:a.b.c.d/path: invalid port ":a.b.c.d" after host and addr ``` Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 683766613a8c1dca8f95b19ddb7e083bb3aef266) Signed-off-by: Sebastiaan van Stijn --- opts/hosts_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opts/hosts_test.go b/opts/hosts_test.go index e46326a5be3a8d4236e217a86b265242a5e478f3..3e79f46d60ef27440603d05b06f7ac74f39a49d0 100644 --- a/opts/hosts_test.go +++ b/opts/hosts_test.go @@ -53,8 +53,8 @@ func TestParseHost(t *testing.T) { func TestParseDockerDaemonHost(t *testing.T) { invalids := map[string]string{ - "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d", - "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path", + "tcp:a.b.c.d": "", + "tcp:a.b.c.d/path": "", "udp://127.0.0.1": "Invalid bind address format: udp://127.0.0.1", "udp://127.0.0.1:2375": "Invalid bind address format: udp://127.0.0.1:2375", "tcp://unix:///run/docker.sock": "Invalid proto, expected tcp: unix:///run/docker.sock", @@ -83,7 +83,7 @@ func TestParseDockerDaemonHost(t *testing.T) { "localhost:5555/path": "tcp://localhost:5555/path", } for invalidAddr, expectedError := range invalids { - if addr, err := parseDaemonHost(invalidAddr); err == nil || err.Error() != expectedError { + if addr, err := parseDaemonHost(invalidAddr); err == nil || expectedError != "" && err.Error() != expectedError { t.Errorf("tcp %v address expected error %q return, got %q and addr %v", invalidAddr, expectedError, err, addr) } } @@ -99,8 +99,8 @@ func TestParseTCP(t *testing.T) { defaultHTTPHost = "tcp://127.0.0.1:2376" ) invalids := map[string]string{ - "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d", - "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path", + "tcp:a.b.c.d": "", + "tcp:a.b.c.d/path": "", "udp://127.0.0.1": "Invalid proto, expected tcp: udp://127.0.0.1", "udp://127.0.0.1:2375": "Invalid proto, expected tcp: udp://127.0.0.1:2375", } @@ -125,7 +125,7 @@ func TestParseTCP(t *testing.T) { "localhost:5555/path": "tcp://localhost:5555/path", } for invalidAddr, expectedError := range invalids { - if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || err.Error() != expectedError { + if addr, err := ParseTCPAddr(invalidAddr, defaultHTTPHost); err == nil || expectedError != "" && err.Error() != expectedError { t.Errorf("tcp %v address expected error %v return, got %s and addr %v", invalidAddr, expectedError, err, addr) } }