CVE-2026-27140: Code execution vulnerability in SWIG code generation in cmd/go
SWIG file names containing 'cgo' and well-crafted payloads could lead to code smuggling and arbitrary code execution at build time due to trust layer bypass.
Security readout for executives and security teams
Plain-English summary
A flaw in the Go toolchain's SWIG code generation lets a malicious source file smuggle code that runs during a normal build. If a developer or build system compiles an untrusted Go project that uses SWIG, the attacker can execute commands on the build machine. The risk is highest for CI pipelines and developer laptops that build code from third-party repositories.
Executive priority
Treat as high-priority patching for engineering platforms this cycle. Business risk is elevated because a single malicious dependency or pull request could compromise build infrastructure and downstream artifacts, but no active exploitation is cited. Schedule Go toolchain upgrades on CI and developer systems and apply vendor errata on any Red Hat-based build hosts.
Technical view
Per the Go advisory and Red Hat references, cmd/go's SWIG integration can be tricked by SWIG file names containing 'cgo' combined with crafted payloads, bypassing the trust layer intended to isolate generated code. This leads to arbitrary code execution at build time. CVSS 3.1 base score is 9.0 (AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H). CWE-501 (trust boundary violation) and CWE-641 (improper restriction of names) are cited. Fixed in Go 1.26.0 and later per the affected-versions record.
Likely exposure
Exposure concentrates on systems that build Go code which imports or vendors SWIG-based packages, particularly shared CI runners, container image build pipelines, and developer workstations that pull third-party modules. Environments that build only first-party code with vetted dependencies see lower practical exposure, but the toolchain itself must still be patched.
Exploitation context
No public sources in the bundle indicate active exploitation, and the CVE is not listed in CISA KEV. Exploitation requires the victim to build attacker-influenced Go source using a vulnerable toolchain, which the CVSS vector reflects as low complexity with required user interaction. Treat CI systems that build untrusted pull requests as the most realistic attack surface.
Researcher notes
Root cause is a trust-layer bypass in cmd/go's SWIG handling, where filenames containing 'cgo' plus crafted payloads escape the intended isolation, aligning with CWE-501 and CWE-641. Affected record lists cmd/go up to 1.26.0-0 as vulnerable; the fix lands in Go 1.26.0 per the Go issue and CL. Red Hat has shipped multiple RHSA errata (e.g., RHSA-2026:16024, 10217, 10704) covering downstream Go packages. Validate exposure by focusing on build pipelines that ingest external Go modules or SWIG-generated bindings.
Mitigation direction
Upgrade the Go toolchain to 1.26.0 or later across developer and CI environments.
Apply vendor updates such as the referenced Red Hat RHSA errata for affected Go packages.
Restrict CI jobs that build untrusted or fork pull-request code to ephemeral, least-privilege runners.
Enforce module and dependency review before builds pull new SWIG-based Go packages.
Monitor golang-announce and Red Hat advisories for any follow-on guidance.
Validation and detection
Inventory Go toolchain versions on workstations, build servers, and container base images.
Confirm installed Go version is 1.26.0 or later, or that vendor-backported fixes are applied.
Audit dependency trees for packages using SWIG (cgo-adjacent generated code) and review their sources.
Check CI runner images and golden templates for updated Go binaries after patching.
Review build logs for unexpected compiler or shell activity during recent Go builds.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-501: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
22Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-501 · source CWE mapping
Trust Boundary Violation
Trust Boundary Violation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Restriction of Names for Files and Other Resources
Improper Restriction of Names for Files and Other Resources represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.