CVE-2026-27140
cmd/go: golang: Go (golang) and cmd/go: Arbitrary Code Execution via malicious SWIG file names
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · April 8, 2026
Updated · October 30, 2026
Description
A flaw was found in the Go programming language (golang) and its command-line tool (cmd/go). A remote attacker could exploit this during the build process by crafting malicious SWIG (Simplified Wrapper and Interface Generator) file names that contain "cgo" and specific payloads. This could lead to code smuggling and arbitrary code execution, bypassing trust mechanisms and allowing the attacker to run unauthorized code.
Statement
This vulnerability is rated as Important because an attacker can achieve arbitrary code execution in the context of the user or build system compiling untrusted source code. Exploitation requires convincing a developer or automated CI/CD pipeline to build or download a malicious Go package containing specially crafted SWIG interface filenames. Pre-compiled binaries and production runtime environments that do not invoke the Go compiler toolchain remain unaffected.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 9CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
CWE-641 · Improper Restriction of Names for Files and Other Resources