Alert

Logo de Go

Alert 2026-168 Go update fixes 12 flaws including a critical cgo issue

Affected product(s): 

ProductAffected versionsFix
Go 1.27From 1.27.0-0 up to, but not including, 1.27.41.27.4 or later
Go 1.26 and earlier majorsVersions earlier than 1.26.11. 1.25 and earlier fall within the official range, but are no longer supported1.26.11 or 1.27.4

The eleven toolchain/cgo flaws mainly affect build environments (CI, development and builders). Vulnerable HTTP/1 services must be recompiled and redeployed. It is not mandatory to recompile already built binaries solely because of those eleven, unless they embed or invoke a vulnerable toolchain. The status of distribution packages has not been verified at this time.

Description

Minor updates 1.27.4 and 1.26.11 of the Go language were published on Nov 10, 2026 at 2:14 p.m. (PYT). The official announcement lists 12 security fixes: eleven in the toolchain and cgo (the go command, the compiler, the linker or cgo) and one in the standard library, in the net/http package. This bulletin is classified as CRITICAL because of CVE-2026-97040, rated CVSS 9.8, critical. That value is a secondary score assigned by a third party; the Go project does not publish CVSS, and the primary CVE record is still under analysis. The other scores in this batch are also secondary.

Eleven of the twelve flaws allow, when a malicious package is built (in most cases, one that uses cgo), the list of permitted flags to be bypassed and code to be executed or options to be injected into the linker during go build or linking. This is not unauthenticated remote code execution against a service that is already deployed. The risk is in the supply chain and in build environments: continuous integration, developer machines, and anyone who builds modules or packages they do not control.

The most serious, CVE-2026-97040 (GO-2026-6851), is in cmd/go and cmd/link: a crafted .syso file can, when the package is built, bypass cgo flag validation and inject directives into the linker. The other ten toolchain/cgo flaws are rated CVSS 8.8, high, except CVE-2026-97039, which is 8.3, high. Some are platform-specific: CVE-2026-97036 only on Darwin, with Apple’s linker; CVE-2026-97041 on ELF platforms; CVE-2026-97042 includes a path on Windows.

The twelfth fix, CVE-2026-97054 (GO-2026-6859), is different: on HTTP/1 servers, a race when setting the close header after the MaxBytesReader or MaxBytesHandler limit is exceeded can cause a panic if the handler reads the body at the same time as it writes the response. It is rated CVSS 5.9, medium, and is not code execution. Services compiled with a vulnerable net/http must be recompiled and redeployed with the new toolchain.

Affected versions are the 1.26 branch earlier than 1.26.11 and the 1.27 branch earlier than 1.27.4 (from 1.27.0-0). Majors 1.25 and earlier also fall within the official range (from 0 up to, but not including, 1.26.11), but, according to the project’s policy, which supports only the two most recent major versions, they no longer receive patches: they must move to 1.26.11 or 1.27.4. The official announcement does not report exploitation in real attacks and, at this time, no verified public proof of concept was found. The project did not publish indicators of compromise. The official vulnerability records (GO-2026-6848 through GO-2026-6859) were published on Nov 10, 2026 at 11:51 p.m. (PYT).

The 12 fixes, described at a high level, are as follows:

CVECVSSSeverityWhat it is
CVE-2026-970409.8criticalA crafted .syso can bypass cgo validation and inject directives into the linker
CVE-2026-970338.8highCompiler or linker flags in #cgo directives can execute code at build time
CVE-2026-970348.8highWith GCC, untrusted “spec” files in search directories can execute commands at link time
CVE-2026-970358.8highWith Clang or GCC, certain #cgo flags can execute code or write files to arbitrary directories
CVE-2026-970368.8highDarwin only, with Apple’s linker: a #cgo LDFLAGS flag can execute code at build time
CVE-2026-970378.8highInjection of linker scripts through split #cgo LDFLAGS flags or certain Darwin or symbol flags
CVE-2026-970388.8high.syso files or cgo linker entries can inject flags or execute code at link time
CVE-2026-970398.3high#cgo pkg-config: directives can load untrusted files or inject flags
CVE-2026-970418.8high//go:cgo_* directives can inject linker flags on ELF platforms
CVE-2026-970428.8high//go:cgo_import_dynamic or a crafted PE object on Windows can pass unsafe arguments to the linker
CVE-2026-970438.8highEscaped quotes in //go:cgo_ldflag can bypass #cgo LDFLAGS validation (execution or a go panic)
CVE-2026-970545.9mediumRace in HTTP/1 servers with MaxBytesReader / MaxBytesHandler that can cause a panic; not code execution

Mitigation

The project did not publish an official workaround. The fix is to update the go tool to 1.27.4 or 1.26.11, or later, including the one actually invoked in each environment (system path, CI image, or the GOTOOLCHAIN variable, if used).

Builders, continuous integration and teams that compile third-party code or modules they do not fully control should be prioritized. On HTTP/1 services that use MaxBytesReader or MaxBytesHandler and write the response while reading the body, the service must be recompiled and redeployed with the new toolchain. Anyone still on 1.25 or an earlier major must move to 1.26.11 or 1.27.4; there is no minor release in this batch for those branches.

The status of distribution packages has not been verified at this time: consult the packager or install the official binaries. The patch does not undo a prior compromise. The project did not publish indicators of compromise.

Solution

The solution is to update the Go toolchain to 1.27.4 or 1.26.11, depending on the major in use, or to a later release, and to install it in every environment that compiles code (development, continuous integration and builders). Recompile and redeploy services that use a net/http from an earlier minor, in particular HTTP/1 servers that use MaxBytesReader or MaxBytesHandler. If an unsupported major is in use (1.25 or earlier), move to 1.26.11 or 1.27.4.

For information on how to update, visit the following link:

https://go.dev/dl/

Additional information: