bump golang 1.13.1 (CVE-2019-16276)
full diff: https://github.com/golang/go/compare/go1.13...go1.13.1
```
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 <github@gone.nl>
2019-09-27 08:26:12 -04:00
|
|
|
ARG GO_VERSION=1.13.1
|
2019-07-17 07:59:16 -04:00
|
|
|
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS base
|
2019-09-11 03:36:53 -04:00
|
|
|
ENV GO111MODULE=off
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
2017-11-03 05:09:06 -04:00
|
|
|
btrfs-progs-dev \
|
2017-09-08 10:43:04 -04:00
|
|
|
build-base \
|
|
|
|
curl \
|
|
|
|
lvm2-dev \
|
2018-10-02 20:57:42 -04:00
|
|
|
jq
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
RUN mkdir -p /build/
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN mkdir -p /go/src/github.com/docker/docker/
|
|
|
|
WORKDIR /go/src/github.com/docker/docker/
|
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
FROM base AS frozen-images
|
|
|
|
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
|
|
|
|
COPY contrib/download-frozen-image-v2.sh /
|
|
|
|
RUN /download-frozen-image-v2.sh /build \
|
2018-02-12 23:52:10 -05:00
|
|
|
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
|
2018-02-27 01:28:29 -05:00
|
|
|
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
|
|
|
|
busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
|
2018-02-12 23:52:10 -05:00
|
|
|
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
|
|
|
|
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
|
2019-04-19 10:15:03 -04:00
|
|
|
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
|
|
|
|
|
2019-04-19 10:24:33 -04:00
|
|
|
FROM base AS dockercli
|
|
|
|
ENV INSTALL_BINARY_NAME=dockercli
|
|
|
|
COPY hack/dockerfile/install/install.sh ./install.sh
|
|
|
|
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
|
|
|
|
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:26:10 -04:00
|
|
|
# Build DockerSuite.TestBuild* dependency
|
|
|
|
FROM base AS contrib
|
|
|
|
COPY contrib/syscall-test /build/syscall-test
|
|
|
|
COPY contrib/httpserver/Dockerfile /build/httpserver/Dockerfile
|
|
|
|
COPY contrib/httpserver contrib/httpserver
|
|
|
|
RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
|
|
|
|
|
|
|
|
# Build the integration tests and copy the resulting binaries to /build/tests
|
2019-04-19 10:24:33 -04:00
|
|
|
FROM base AS builder
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
# Set tag and add sources
|
2019-04-19 10:20:24 -04:00
|
|
|
COPY . .
|
2019-04-27 00:38:55 -04:00
|
|
|
# Copy test sources tests that use assert can print errors
|
|
|
|
RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
|
|
|
|
# Build and install test binaries
|
2019-04-30 03:22:22 -04:00
|
|
|
ARG DOCKER_GITCOMMIT=undefined
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN hack/make.sh build-integration-test-binary
|
2019-04-27 00:38:55 -04:00
|
|
|
RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
## Generate testing image
|
2019-06-23 13:39:20 -04:00
|
|
|
FROM alpine:3.10 as runner
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:20:24 -04:00
|
|
|
ENV DOCKER_REMOTE_DAEMON=1
|
|
|
|
ENV DOCKER_INTEGRATION_DAEMON_DEST=/
|
|
|
|
ENTRYPOINT ["/scripts/run.sh"]
|
|
|
|
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
|
|
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
|
|
|
|
2017-09-08 10:43:04 -04:00
|
|
|
# GNU tar is used for generating the emptyfs image
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
g++ \
|
|
|
|
git \
|
|
|
|
iptables \
|
2018-01-16 13:49:18 -05:00
|
|
|
pigz \
|
2017-09-08 10:43:04 -04:00
|
|
|
tar \
|
2018-10-02 20:57:42 -04:00
|
|
|
xz
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:20:24 -04:00
|
|
|
COPY hack/test/e2e-run.sh /scripts/run.sh
|
|
|
|
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:02:22 -04:00
|
|
|
COPY integration/testdata /tests/integration/testdata
|
|
|
|
COPY integration/build/testdata /tests/integration/build/testdata
|
|
|
|
COPY integration-cli/fixtures /tests/integration-cli/fixtures
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
COPY --from=frozen-images /build/ /docker-frozen-images
|
2019-04-19 10:24:33 -04:00
|
|
|
COPY --from=dockercli /build/ /usr/bin/
|
2019-04-19 10:26:10 -04:00
|
|
|
COPY --from=contrib /build/ /tests/contrib/
|
2019-04-27 00:38:55 -04:00
|
|
|
COPY --from=builder /build/ /
|