Browse code

update to Go 1.26.2

go1.26.2 (released 2026-04-07) includes security fixes to the go command,
the compiler, and the archive/tar, crypto/tls, crypto/x509, html/template,
and os packages, as well as bug fixes to the go command, the go fix command,
the compiler, the linker, the runtime, and the net, net/http, and net/url
packages. See the Go 1.26.2 milestone on our issue tracker for details;

- https://github.com/golang/go/issues?q=milestone%3AGo1.26.2+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.26.1...go1.26.2

From the security announce:

We have just released Go versions 1.26.2 and 1.25.9, minor point releases.

These releases include 10 security fixes following the security policy:

- os: Root.Chmod can follow symlinks out of the root on Linux

On Linux, if the target of Root.Chmod is replaced with a symlink while
the chmod operation is in progress, Chmod could operate on the target
of the symlink, even when the target lies outside the root.

The Linux fchmodat syscall silently ignores the AT_SYMLINK_NOFOLLOW flag,
which Root.Chmod uses to avoid symlink traversal. Root.Chmod checks its
target before acting and returns an error if the target is a symlink
lying outside the root, so the impact is limited to cases where the
target is replaced with a symlink between the check and operation.

On Linux, Root.Chmod now uses the fchmodat2 syscall when available, and
an workaround using /proc/self/fd otherwise.

Thanks to Uuganbayar Lkhamsuren for reporting this issue.

This is CVE-2026-32282 and Go issue https://go.dev/issue/78293.

- html/template: JS template literal context incorrectly tracked

Context was not properly tracked across template branches for JS template
literals, leading to possibly incorrect escaping of content when branches were
used.

Additionally template actions within JS template literals did not properly
track
the brace depth, leading to incorrect escaping being applied.

These issues could cause actions within JS template literals to be incorrectly
or improperly escaped, leading to XSS vulnerabilities.

This only affects templates that use template actions within JS template
literals.

This is CVE-2026-32289 and Go issue https://go.dev/issue/78331.

- crypto/x509: excluded DNS constraints not properly applied to wildcard domains

When verifying a certificate chain containing excluded DNS constraints, these
constraints are not correctly applied to wildcard DNS SANs which use a
different
case than the constraint.

For example, if a certificate contains the DNS name "*.example.com" and the
excluded DNS name "EXAMPLE.COM", the constraint will not be applied.

This only affects validation of otherwise trusted certificate chains, issued
by
a root CA in the VerifyOptions.Roots CertPool, or in the system certificate
pool.

This issue only affects Go 1.26.

Thank you to Riyas from Saintgits College of Engineering, k1rnt, @1seal for
reporting this issue.

This is CVE-2026-33810 and Go issue https://go.dev/issue/78332.

- cmd/compile: no-op interface conversion bypasses overlap checking

Previously, the compiler failed to unwrap pointers contained within
a no-op interface conversion leading to an incorrect determination
of a non-overlapping move.

To prevent unsafe move operations, the compiler will now unwrap all
such conversions before considering a move non-overlapping.

Thank you to Jakub Ciolek - https://ciolek.dev/ for reporting this issue.

This is CVE-2026-27144 and Go issue https://go.dev/issue/78371.

- cmd/compile: possible memory corruption after bound check elimination

Previously, slices and arrays accessed using induction variables
were sometimes incorrectly proved in-bound. If the induction variable
used for indexing were to overflow or underflow, it could allow access
to memory beyond the scope of the original slice or array.

To prevent this behavior, the compiler ensures that any mutated induction
variable that overflows/underflows with respect to its loop condition
is not used for bound check elimination.

Thank you to Jakub Ciolek - https://ciolek.dev/ for reporting this issue.

This is CVE-2026-27143 and Go issue https://go.dev/issue/78333.

- archive/tar: unbounded allocation when parsing old format GNU sparse map

tar.Reader could allocate an unbounded amount of memory when reading
a maliciously-crafted archive containing a large number of sparse
regions encoded in the "old GNU sparse map" format.

We now limit both the number of old GNU sparse map extension blocks,
and the total number of sparse file entries, regardless of encoding.

Thanks to Colin Walters (wal...@verbum.org) who initially reported this issue.
Thanks also to Uuganbayar Lkhamsuren (https://github.com/uug4na) and Jakub
Ciolek
who additionally reported this issue.

This is CVE-2026-32288 and Go issue https://go.dev/issue/78301.

- crypto/tls: multiple key update handshake messages can cause connection to
deadlock

If one side of the TLS connection sends multiple key update messages
post-handshake in a single record, the connection can deadlock, causing
uncontrolled consumption of resources. This can lead to a denial of service.

This only affects TLS 1.3.

Thank you to Jakub Ciolek - https://ciolek.dev/ for reporting this issue.

This is CVE-2026-32283 and Go issue https://go.dev/issue/78334.

- cmd/go: trust layer bypass when using cgo and SWIG

A well-crafted SWIG source file could take advantage
of a file-naming convention used inside the trust
boundary of the cgo compiler. Doing so could result
in arbitrary code execution during build time.

SWIG files are disallowed from using this convention.

Thank you to Juho Forsén of Mattermost for reporting this issue.

This is CVE-2026-27140 and Go issue https://go.dev/issue/78335.

- crypto/x509: unexpected work during chain building

During chain building, the amount of work that is done is not correctly
limited
when a large number of intermediate certificates are passed in
VerifyOptions.Intermediates, which can lead to a denial of service. This
affects
both direct users of crypto/x509 and users of crypto/tls.

Thank you to Jakub Ciolek - https://ciolek.dev/ for reporting this issue.

This is CVE-2026-32280 and Go issue https://go.dev/issue/78282.

- crypto/x509: inefficient policy validation

Validating certificate chains which use policies is unexpectedly inefficient
when certificates in the chain contain a very large number of policy mappings,
possibly causing denial of service.

This only affects validation of otherwise trusted certificate chains, issued
by
a root CA in the VerifyOptions.Roots CertPool, or in the system certificate
pool.

Thank you to Jakub Ciolek - https://ciolek.dev/ for reporting this issue.

This is CVE-2026-32281 and Go issue https://go.dev/issue/78281.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2026/04/08 07:41:01
Showing 15 changed files
... ...
@@ -16,7 +16,7 @@ on:
16 16
   workflow_call:
17 17
 
18 18
 env:
19
-  GO_VERSION: "1.26.1"
19
+  GO_VERSION: "1.26.2"
20 20
   GOTESTLIST_VERSION: v0.3.1
21 21
   TESTSTAT_VERSION: v0.1.25
22 22
   SETUP_BUILDX_VERSION: edge
... ...
@@ -21,7 +21,7 @@ on:
21 21
         default: "graphdriver"
22 22
 
23 23
 env:
24
-  GO_VERSION: "1.26.1"
24
+  GO_VERSION: "1.26.2"
25 25
   GOTESTLIST_VERSION: v0.3.1
26 26
   TESTSTAT_VERSION: v0.1.25
27 27
   ITG_CLI_MATRIX_SIZE: 6
... ...
@@ -25,7 +25,7 @@ on:
25 25
         default: ""
26 26
 
27 27
 env:
28
-  GO_VERSION: "1.26.1"
28
+  GO_VERSION: "1.26.2"
29 29
   TESTSTAT_VERSION: v0.1.25
30 30
   TEMPLATE_NAME: ${{ inputs.template }}
31 31
 
... ...
@@ -28,7 +28,7 @@ on:
28 28
         default: false
29 29
 
30 30
 env:
31
-  GO_VERSION: "1.26.1"
31
+  GO_VERSION: "1.26.2"
32 32
   GOTESTLIST_VERSION: v0.3.1
33 33
   TESTSTAT_VERSION: v0.1.25
34 34
   WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
... ...
@@ -23,7 +23,7 @@ on:
23 23
   pull_request:
24 24
 
25 25
 env:
26
-  GO_VERSION: "1.26.1"
26
+  GO_VERSION: "1.26.2"
27 27
   TESTSTAT_VERSION: v0.1.25
28 28
   DESTDIR: ./build
29 29
   SETUP_BUILDX_VERSION: edge
... ...
@@ -23,7 +23,7 @@ on:
23 23
   pull_request:
24 24
 
25 25
 env:
26
-  GO_VERSION: "1.26.1"
26
+  GO_VERSION: "1.26.2"
27 27
   DESTDIR: ./build
28 28
   SETUP_BUILDX_VERSION: edge
29 29
   SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
... ...
@@ -34,7 +34,7 @@ on:
34 34
     - cron: '0 9 * * 4'
35 35
 
36 36
 env:
37
-  GO_VERSION: "1.26.1"
37
+  GO_VERSION: "1.26.2"
38 38
 
39 39
 jobs:
40 40
   codeql:
... ...
@@ -23,7 +23,7 @@ on:
23 23
   pull_request:
24 24
 
25 25
 env:
26
-  GO_VERSION: "1.26.1"
26
+  GO_VERSION: "1.26.2"
27 27
   GIT_PAGER: "cat"
28 28
   PAGER: "cat"
29 29
   SETUP_BUILDX_VERSION: edge
... ...
@@ -2,7 +2,7 @@ version: "2"
2 2
 
3 3
 run:
4 4
   # prevent golangci-lint from deducting the go version to lint for through go.mod,
5
-  go: "1.26.1"
5
+  go: "1.26.2"
6 6
   # Only supported with go modules enabled (build flag -mod=vendor only valid when using modules)
7 7
   # modules-download-mode: vendor
8 8
 
... ...
@@ -1,6 +1,6 @@
1 1
 # syntax=docker/dockerfile:1
2 2
 
3
-ARG GO_VERSION=1.26.1
3
+ARG GO_VERSION=1.26.2
4 4
 ARG BASE_DEBIAN_DISTRO="bookworm"
5 5
 ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
6 6
 
... ...
@@ -5,7 +5,7 @@
5 5
 
6 6
 # This represents the bare minimum required to build and test Docker.
7 7
 
8
-ARG GO_VERSION=1.26.1
8
+ARG GO_VERSION=1.26.2
9 9
 
10 10
 ARG BASE_DEBIAN_DISTRO="bookworm"
11 11
 ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
... ...
@@ -161,7 +161,7 @@ FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
161 161
 # Use PowerShell as the default shell
162 162
 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
163 163
 
164
-ARG GO_VERSION=1.26.1
164
+ARG GO_VERSION=1.26.2
165 165
 
166 166
 # GOTESTSUM_VERSION is the version of gotest.tools/gotestsum to install.
167 167
 ARG GOTESTSUM_VERSION=v1.13.0
... ...
@@ -1,6 +1,6 @@
1 1
 # syntax=docker/dockerfile:1
2 2
 
3
-ARG GO_VERSION=1.26.1
3
+ARG GO_VERSION=1.26.2
4 4
 
5 5
 FROM golang:${GO_VERSION}-alpine AS base
6 6
 RUN apk add --no-cache bash make yamllint
... ...
@@ -1,6 +1,6 @@
1 1
 # syntax=docker/dockerfile:1
2 2
 
3
-ARG GO_VERSION=1.26.1
3
+ARG GO_VERSION=1.26.2
4 4
 ARG BASE_DEBIAN_DISTRO="bookworm"
5 5
 ARG PROTOC_VERSION=3.11.4
6 6
 
... ...
@@ -1,6 +1,6 @@
1 1
 # syntax=docker/dockerfile:1
2 2
 
3
-ARG GO_VERSION=1.26.1
3
+ARG GO_VERSION=1.26.2
4 4
 ARG GOVULNCHECK_VERSION=v1.1.4
5 5
 ARG FORMAT=text
6 6