CVE-2026-27140
Go vulnerability analysis and mitigation

Overview

CVE-2026-27140 is a code smuggling vulnerability in Go's cmd/go component that allows arbitrary code execution at build time by exploiting a trust layer bypass via specially crafted SWIG filenames containing 'cgo'. It affects Go versions prior to 1.25.9 and versions 1.26.0 through 1.26.1 (prior to 1.26.2). The vulnerability was published on April 8, 2026, and carries a CVSS v3.1 base score of 8.8 (High) (GitHub Advisory, pkg.go.dev).

Technical details

The root cause is classified as CWE-863 (Incorrect Authorization), specifically a trust boundary bypass in Go's build toolchain (cmd/go). When Go processes SWIG-generated interface files, it fails to correctly validate filenames containing the string 'cgo', allowing an attacker to craft a malicious SWIG file whose name tricks the build system into treating embedded payloads as trusted cgo directives. This results in arbitrary code being executed at build time without proper authorization checks. The fix is tracked in Go issue #78335 and code change CL 763768 (GitHub Advisory, pkg.go.dev).

Impact

Successful exploitation results in arbitrary code execution on the developer's or CI/CD build machine at build time, with full confidentiality, integrity, and availability impact. An attacker who can introduce a malicious SWIG file into a Go project's dependency chain or source tree can compromise the entire build environment, potentially exfiltrating source code, secrets, or credentials, injecting backdoors into build artifacts, or disrupting the build pipeline. The scope of impact extends beyond the immediate build host to any downstream systems that consume the compromised build artifacts (GitHub Advisory, Feedly).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the time of publication (GitHub Advisory). Exploitation requires user interaction — specifically, a developer or automated build system must build a Go project that includes the malicious SWIG file. The EPSS score is approximately 0.008–0.015%, indicating a low near-term exploitation probability. No threat actor attribution has been reported, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (GitHub Advisory, pkg.go.dev).

Exploitation steps

  1. Craft a malicious SWIG file: Create a SWIG interface file with a filename containing the string 'cgo' (e.g., wrapper_cgo.swig). Embed a well-crafted payload within the file that exploits the trust boundary bypass in Go's cmd/go build processing.
  2. Introduce the file into the target project: Deliver the malicious SWIG file via a supply chain attack (e.g., a compromised dependency, a malicious pull request, or direct repository access).
  3. Trigger the build: Wait for or socially engineer a developer or CI/CD pipeline to run go build or equivalent on the affected project. User interaction (initiating a build) is required.
  4. Achieve code execution: During the build process, cmd/go incorrectly authorizes the malicious SWIG filename as a trusted cgo source, causing the embedded payload to execute arbitrary code in the context of the build environment — enabling credential theft, backdoor installation, or artifact tampering (GitHub Advisory, pkg.go.dev).

Indicators of compromise

  • File System: Presence of unexpected SWIG files (.swig or .swigcxx) with 'cgo' in the filename in project source trees or dependency caches; unexpected modifications to generated cgo files (e.g., _cgo_gotypes.go, _cgo_export.h) not matching known-good checksums.
  • Process: Unusual child processes spawned during go build execution (e.g., shell commands, network utilities like curl, wget, or nc); unexpected outbound network connections originating from the build process.
  • Logs: Build logs showing unexpected cgo compilation steps for SWIG files not present in the original source; error messages or anomalous output from cmd/go related to SWIG file processing.
  • Network: Outbound connections to unknown external hosts from the build server during or immediately after a Go build operation.

Mitigation and workarounds

Upgrade Go to version 1.25.9 or later (for the 1.25.x branch) or 1.26.2 or later (for the 1.26.x branch) to receive the patch (pkg.go.dev, golang-announce). All developers and CI/CD build environments should be updated to a patched Go version. As an interim measure, audit all SWIG files in your project and dependency chain — particularly any with 'cgo' in the filename — and implement code review controls for dependency changes. Vendor advisories from Red Hat, SUSE, openSUSE, and Amazon Linux have also issued updated packages for their respective distributions (Red Hat, openSUSE).

Community reactions

The Go team disclosed the vulnerability via the golang-announce mailing list and published a fix in Go 1.25.9 and 1.26.2 (golang-announce). The vulnerability was also discussed on oss-security (oss-sec) and picked up by downstream Linux distributions including Red Hat, SUSE, openSUSE, Amazon Linux, and Rocky Linux, which issued their own security advisories. Community coverage has been moderate, with vulnerability tracking sites and security blogs noting the build-time code execution risk, though no significant controversy or widespread alarm has been reported given the lack of known active exploitation.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

golang-1.19

Affected

sid

golang-1.26: 1.26.2-1

Fixed

trixie

golang-1.24

Affected

Ubuntu

Affected

bionic (esm-apps)

golang-1.13

Affected

bionic (esm-infra)

golang-1.10

Affected

devel

golang-1.23

Affected

focal (esm-apps)

golang-1.16

Affected

focal (esm-infra)

golang-1.13

Affected

jammy

golang-1.13

Affected

jammy (esm-apps)

golang-1.13

Affected

noble

golang-1.21

Affected

RHEL / CentOS

Fixed

OpenShift

el9:openshift4/ose-docker-builder-rhel9-0:v4.16.0

Fixed

RHEL 8

:appstream:go-toolset:rhel8/golang/go-toolset

Fixed

RHEL 9

:appstream:golang-0:1.17.13-12.el9_0.src

Fixed

RHEL 10

golang-0:1.25.9-1.el10_0.src

Fixed

Alpine

Fixed

edge

go: 1.26.2-r0, 1.73.5-r0

Fixed

v3.23

go: 1.25.9-r0

Fixed

SourceThis report was generated using AI

Related Go vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-56865HIGH8.4
  • Go logoGo
  • gitlab-cng-19.1
NoYesAug 13, 2026
CVE-2026-56864HIGH7.5
  • Go logoGo
  • kyverno-readiness-checker-1.17
NoYesAug 13, 2026
CVE-2026-56862HIGH7.5
  • Go logoGo
  • kepler-fips
NoYesAug 13, 2026
CVE-2026-56859HIGH7.5
  • Go logoGo
  • grafana-elasticsearch
NoYesAug 13, 2026
CVE-2026-56860MEDIUM5.9
  • Go logoGo
  • crossplane-provider-aws-cur-fips
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management