CVE-2026-27140 Code execution vulnerability in SWIG code generation in cmd/go
Attackers can execute arbitrary code during build time by crafting SWIG filenames that bypass trust layers in the Go toolchain.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-27140?
CVE-2026-27140 is a high-severity code injection vulnerability in Golang Go, published on 8 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
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.
Which versions are affected by CVE-2026-27140?
2 open source packages ship an affected version, including golang and toolchain. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.25.9, 1.26.2 |
toolchain Go | All versions | 1.25.9, 1.26.2 |
Linux distribution packages (38)
delve Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb |
delve-debuginfo Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb |
delve-debugsource Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb |
go-toolset Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-3.module+el8.4.0+22765+91da4d3f |
golang Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-bin Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-docs Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-misc Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-race Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-src Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
golang-tests Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.15.14-22.module+el8.4.0+24267+d2faeddf |
delve Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
delve-debuginfo Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
delve-debugsource Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
go-toolset Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-2.module+el8.6.0+22782+bd95fb4c |
golang Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-bin Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-docs Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-misc Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-race Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-src Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-tests Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
delve Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
delve-debuginfo Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
delve-debugsource Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.7.2-1.module+el8.6.0+12972+ebab5911 |
go-toolset Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-2.module+el8.6.0+22782+bd95fb4c |
golang Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-bin Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-docs Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-misc Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-race Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-src Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
golang-tests Red Hat:rhel_e4s:8.6::appstream | All versions | 0:1.17.13-16.module+el8.6.0+24266+ace38400 |
delve Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
delve-debuginfo Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
delve-debugsource Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.9.1-1.module+el8.8.0+16778+5fbb74f5 |
go-toolset Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-4.module+el8.8.0+23976+18ba1869 |
golang Red Hat:rhel_e4s:8.8::appstream | All versions | 0:1.19.13-24.module+el8.8.0+24268+9f9e0e19 |
Products include Golang Go.
How do I fix CVE-2026-27140?
Upgrade golang to a fixed version for your release line: 1.25.9 or 1.26.2.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-27140 being exploited?
There is no known exploitation of CVE-2026-27140 in the wild and no public exploit code.
Other vulnerabilities in Golang Go
- CVE-2020-0601 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
Sources
Also known as AZL-98607, BELL-CVE-2026-27140, BIT-golang-2026-27140, CLEANSTART-2026-GQ35594, CLEANSTART-2026-KD34055, CLEANSTART-2026-OK73778 and 648 more.