CVE-2025-61732
Go vulnerability analysis and mitigation

Overview

CVE-2025-61732 is a code injection vulnerability in the Go programming language's cmd/cgo tool, caused by a discrepancy between how Go and C/C++ comments are parsed, enabling "code smuggling" into the resulting cgo binary. It affects all Go versions before 1.24.13 and Go 1.25.x versions before 1.25.7. The vulnerability was published on February 5, 2026, and patches were released the same day. It carries a CVSS v3.1 base score of 8.6 (High) (Go Vuln DB, IBM Advisory).

Technical details

The root cause is classified as CWE-94 (Improper Control of Generation of Code / Code Injection). The vulnerability arises because Go's cmd/cgo tool parses comments differently than C/C++ compilers: an attacker can craft specially formatted comment blocks that are treated as inert by Go's parser but are interpreted as executable C/C++ code by the C compiler during the cgo build process. This parsing inconsistency allows malicious code to be "smuggled" into the compiled binary without being visible as active code in the Go source. Exploitation requires local access and user interaction — specifically, a victim must compile a malicious or attacker-influenced cgo project (Go Issue, Go CL, Go Vuln DB).

Impact

Successful exploitation results in high impact across confidentiality, integrity, and availability, with a changed scope indicating effects beyond the vulnerable component itself. An attacker who can influence cgo source code (e.g., via a malicious dependency or supply chain compromise) could inject arbitrary C code that executes when the binary is run, potentially enabling unauthorized data access, system compromise, or denial of service. The local attack vector limits remote exploitation, but the supply chain angle makes this particularly relevant for Go projects that use cgo and consume third-party packages (Go Vuln DB, IBM Advisory).

Exploitability

As of the time of disclosure, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Go Vuln DB). The EPSS score is approximately 0.013% (0.000130), reflecting a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No threat actor attribution has been reported. Detection signatures have been published by Qualys and Tenable/Nessus for scanner-based identification.

Exploitation steps

  1. Identify a target: Find a Go project that uses cgo (i.e., imports "C" and calls C code) and accepts external contributions or third-party dependencies.
  2. Craft a malicious comment payload: Construct a specially formatted comment in a .go file that is syntactically valid and inert from Go's perspective, but is interpreted as executable C code by the C/C++ compiler during cgo processing. For example, exploit the difference in how block comment terminators or nested comments are handled between Go and C parsers.
  3. Introduce the payload: Insert the malicious comment into a cgo source file via a dependency, pull request, or direct file modification in a project the victim will compile.
  4. Victim compiles the project: When the victim runs go build or go install on the affected project, cmd/cgo processes the source and passes the smuggled C code to the C compiler, which compiles it into the resulting binary.
  5. Malicious code executes: When the compiled binary is run, the injected C code executes with the privileges of the binary, potentially enabling arbitrary code execution, data exfiltration, or persistence (Go Issue, Go Vuln DB).

Indicators of compromise

  • File System: Unexpected or obfuscated comment blocks in .go files that import "C", particularly those containing C-like syntax within comment delimiters; cgo-generated intermediate files (e.g., _cgo_*.c) containing unexpected function definitions or system calls.
  • Build Process: Build logs showing unexpected C compiler warnings or errors related to comment parsing; unusual symbols or functions appearing in compiled binaries that are not present in the visible Go source.
  • Dependency/Supply Chain: Recently modified third-party cgo dependencies with comment-heavy C interop sections; unexpected changes to go.sum or go.mod referencing unfamiliar module versions.
  • Runtime: Unexpected network connections, file writes, or process spawning from binaries built with cgo from untrusted sources (Go Issue, Go Vuln DB).

Mitigation and workarounds

Upgrade to Go 1.24.13 or later (for the 1.24.x branch) or Go 1.25.7 or later (for the 1.25.x branch), which contain the fix for this parsing discrepancy (Go CL, Go Vuln DB). Organizations using downstream distributions should apply vendor-specific patches: Red Hat has issued RHSA-2026:2706, RHSA-2026:2708, RHSA-2026:2709, and subsequent advisories; SUSE, openSUSE, AlmaLinux, Rocky Linux, Amazon Linux 2, and Mageia have also released updated packages. As an interim measure, audit all cgo projects for suspicious comment patterns and restrict the use of untrusted cgo dependencies. IBM Financial Transaction Manager users should refer to the IBM advisory for product-specific guidance (IBM Advisory).

Community reactions

The Go team announced the fix via the golang-announce mailing list and social media (Bluesky, Mastodon) upon releasing Go 1.25.7 and 1.24.13 (golang-announce). Security news outlets including GBHackers, IT Security News, CyberPress, and UnderCodeNews covered the release, highlighting the code smuggling angle as a notable supply chain risk. The Hacker Wire published a dedicated technical write-up on the cgo comment parsing discrepancy. Community discussion on Reddit's CVEWatch subreddit listed CVE-2025-61732 among the top trending CVEs in the days following disclosure. Istio also issued a security release (1.27.7) referencing this vulnerability, indicating broad ecosystem impact (Istio Release).

Additional resources


SourceThis report was generated using AI

Related Go vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2023-54365HIGH8.7
  • Go logoGo
  • trigger-dev
NoYesJun 23, 2026
CVE-2026-39822HIGH7.8
  • Go logoGo
  • timestamp-authority-fips
NoYesJul 08, 2026
CVE-2026-42504HIGH7.5
  • Go logoGo
  • buildah-tests
NoYesJun 02, 2026
CVE-2026-42505MEDIUM5.3
  • Go logoGo
  • gomplate-4
NoYesJul 08, 2026
CVE-2026-42507MEDIUM5.3
  • Go logoGo
  • libcap
NoYesJun 02, 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