Skip to content

Commit e60cdf2

Browse files
ausphamCopilot
andcommitted
fix: resolve April 2026 docker-ptf security vulnerabilities
- Upgrade Go toolchain 1.25.8 → 1.25.9 (fixes CVE-2026-32280 through CVE-2026-32289: stdlib crypto/tls, archive/tar, html/template, os) - Bump go.opentelemetry.io/otel/sdk v1.40.0 → v1.43.0 in gnmic (CVE-2026-39883: PATH hijacking via BSD kenv) - Add github.com/go-jose/go-jose/[email protected] to gnmic, gnoic, grpcurl (CVE-2026-34986: DoS via crafted JSON Web Encryption) - Bump github.com/docker/docker to latest in gnmic (CVE-2026-34040: authorization bypass, CVE-2026-33997: privilege validation bypass during plugin installation) - Add aws-sdk-go-v2 eventstream/s3 latest to gnmic (GHSA-xmrv-pmrh-hhx2: DoS via panic in AWS SDK for Go v2) - Existing apt-get upgrade covers libpng16-16 fix (CVE-2026-33416: use-after-free, CVE-2026-33636: OOB read/write) Co-authored-by: Copilot <[email protected]> Signed-off-by: Ubuntu <austinpham@austinpham-dev-vm-2.d4y3nv5wwgfelhhopdxv1tqjld.dx.internal.cloudapp.net> Signed-off-by: Austin Pham (agent) <[email protected]>
1 parent 339a245 commit e60cdf2

2 files changed

Lines changed: 66 additions & 5 deletions

File tree

dockers/docker-ptf/Dockerfile.j2

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,17 @@ RUN apt-get update \
107107
# to ensure they use a patched Go stdlib (GO-2026-4337: crypto/tls)
108108
{% if CONFIGURED_ARCH == "armhf" %}
109109
RUN GO_ARCH=armv6l \
110+
&& GO_SHA256=7d4f0d266d871301e08ef4ac31c56e66048688893b2848392e5c600276351ee8 \
110111
{% elif CONFIGURED_ARCH == "arm64" %}
111112
RUN GO_ARCH=arm64 \
113+
&& GO_SHA256=ec342e7389b7f489564ed5463c63b16cf8040023dabc7861256677165a8c0e2b \
112114
{% else %}
113115
RUN GO_ARCH=amd64 \
116+
&& GO_SHA256=00859d7bd6defe8bf84d9db9e57b9a4467b2887c18cd93ae7460e713db774bc1 \
114117
{% endif %}
115-
&& GO_VERSION=1.25.8 \
118+
&& GO_VERSION=1.25.9 \
116119
&& curl -L "https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" -o /tmp/go.tar.gz \
120+
&& echo "${GO_SHA256} /tmp/go.tar.gz" | sha256sum -c - \
117121
&& tar -C /usr/local -xzf /tmp/go.tar.gz \
118122
&& rm /tmp/go.tar.gz
119123

@@ -125,12 +129,14 @@ RUN GRPCURL_VERSION=v1.9.3 \
125129
&& git clone --depth 1 --branch "${GRPCURL_VERSION}" https://github.com/fullstorydev/grpcurl.git /tmp/grpcurl \
126130
&& cd /tmp/grpcurl \
127131
&& go get google.golang.org/[email protected] \
132+
&& go get github.com/go-jose/go-jose/v4@latest \
128133
&& go get golang.org/x/crypto@latest golang.org/x/net@latest golang.org/x/text@latest golang.org/x/sys@latest golang.org/x/oauth2@latest \
129134
&& go mod tidy \
130135
&& go build -o /usr/local/bin/grpcurl ./cmd/grpcurl \
131136
&& chmod +x /usr/local/bin/grpcurl \
132-
&& rm -rf /tmp/grpcurl
137+
&& rm -rf /tmp/grpcurl /root/go/pkg/mod /root/.cache/go-build
133138
# Security fixes: upgrade all vulnerable system packages (S360 scan remediation)
139+
# Covers CVE-2026-33416 and CVE-2026-33636 (libpng16-16) among others
134140
RUN apt-get update && apt-get upgrade -y \
135141
&& rm -rf /var/lib/apt/lists/*
136142

@@ -406,27 +412,35 @@ RUN git clone https://github.com/karimra/gnoic.git \
406412
&& git checkout 27bc5a6 \
407413
&& go get google.golang.org/[email protected] \
408414
&& go get github.com/go-viper/mapstructure/[email protected] \
415+
&& go get github.com/go-jose/go-jose/v4@latest \
409416
&& go get golang.org/x/crypto@latest golang.org/x/net@latest golang.org/x/text@latest golang.org/x/sys@latest golang.org/x/oauth2@latest \
410417
&& go mod tidy \
411418
&& go build -o /usr/local/bin/gnoic . \
412419
&& cd .. \
413-
&& rm -rf gnoic
420+
&& rm -rf gnoic /root/go/pkg/mod /root/.cache/go-build
414421

415422
# Build gnmic from source with upgraded deps to address known CVEs
423+
COPY gocloud-patches/ /tmp/gocloud-patches/
416424
RUN GNMIC_VERSION=v0.43.0 \
417425
&& git clone --depth 1 --branch "${GNMIC_VERSION}" https://github.com/openconfig/gnmic.git /tmp/gnmic \
418426
&& cd /tmp/gnmic \
419427
&& go get google.golang.org/[email protected] \
420428
&& go get github.com/cloudflare/[email protected] \
421429
&& go get github.com/go-git/go-git/v5@latest \
422430
&& go get github.com/nats-io/nats-server/v2@latest \
423-
&& go get go.opentelemetry.io/otel/sdk@v1.40.0 \
431+
&& go get go.opentelemetry.io/otel/sdk@latest \
424432
&& go get github.com/docker/docker@latest \
433+
&& go get github.com/go-jose/go-jose/v4@latest \
434+
&& go get github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream@latest github.com/aws/aws-sdk-go-v2/service/s3@latest github.com/aws/aws-sdk-go-v2/feature/s3/manager@latest \
425435
&& go get golang.org/x/crypto@latest golang.org/x/net@latest golang.org/x/text@latest golang.org/x/sys@latest golang.org/x/oauth2@latest \
436+
&& go get [email protected] \
426437
&& go mod tidy \
438+
&& GOCLOUD_DIR="$(go list -m -f '{{ '{{' }}.Dir{{ '}}' }}' gocloud.dev)" \
439+
&& chmod -R +w "$GOCLOUD_DIR" \
440+
&& patch --forward -d "$GOCLOUD_DIR" -p1 < /tmp/gocloud-patches/0001-fix-aws-sdk-go-v2-pointer-api-changes.patch \
427441
&& go build -o /usr/local/bin/gnmic . \
428442
&& chmod +x /usr/local/bin/gnmic \
429-
&& rm -rf /tmp/gnmic
443+
&& rm -rf /tmp/gnmic /tmp/gocloud-patches /root/go/pkg/mod /root/.cache/go-build
430444

431445
# Remove Go toolchain to reduce image size
432446
RUN rm -rf /usr/local/go "$(go env GOPATH 2>/dev/null || echo $HOME/go)"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--- a/blob/s3blob/s3blob.go 2026-04-09 22:48:10.700372961 +0000
2+
+++ b/blob/s3blob/s3blob.go 2026-04-09 22:48:19.654602364 +0000
3+
@@ -399,7 +399,7 @@
4+
if b.useV2 {
5+
in := &s3v2.ListObjectsV2Input{
6+
Bucket: aws.String(b.name),
7+
- MaxKeys: int32(pageSize),
8+
+ MaxKeys: aws.Int32(int32(pageSize)),
9+
}
10+
if len(opts.PageToken) > 0 {
11+
in.ContinuationToken = aws.String(string(opts.PageToken))
12+
@@ -425,7 +425,7 @@
13+
page.Objects[i] = &driver.ListObject{
14+
Key: unescapeKey(aws.StringValue(obj.Key)),
15+
ModTime: *obj.LastModified,
16+
- Size: obj.Size,
17+
+ Size: aws.Int64Value(obj.Size),
18+
MD5: eTagToMD5(obj.ETag),
19+
AsFunc: func(i interface{}) bool {
20+
p, ok := i.(*typesv2.Object)
21+
@@ -576,7 +576,7 @@
22+
var nextContinuationToken *string
23+
if legacyResp.NextMarker != nil {
24+
nextContinuationToken = legacyResp.NextMarker
25+
- } else if legacyResp.IsTruncated {
26+
+ } else if aws.BoolValue(legacyResp.IsTruncated) {
27+
nextContinuationToken = aws.String(aws.StringValue(legacyResp.Contents[len(legacyResp.Contents)-1].Key))
28+
}
29+
return &s3v2.ListObjectsV2Output{
30+
@@ -706,7 +706,7 @@
31+
Metadata: md,
32+
// CreateTime not supported; left as the zero time.
33+
ModTime: aws.TimeValue(resp.LastModified),
34+
- Size: resp.ContentLength,
35+
+ Size: aws.Int64Value(resp.ContentLength),
36+
MD5: eTagToMD5(resp.ETag),
37+
ETag: aws.StringValue(resp.ETag),
38+
AsFunc: func(i interface{}) bool {
39+
@@ -803,7 +803,7 @@
40+
attrs: driver.ReaderAttributes{
41+
ContentType: aws.StringValue(resp.ContentType),
42+
ModTime: aws.TimeValue(resp.LastModified),
43+
- Size: getSize(resp.ContentLength, aws.StringValue(resp.ContentRange)),
44+
+ Size: getSize(aws.Int64Value(resp.ContentLength), aws.StringValue(resp.ContentRange)),
45+
},
46+
rawV2: resp,
47+
}, nil

0 commit comments

Comments
 (0)