CVE-2025-61732: CWE-94: Improper Control of Generation of Code ('Code Injection') in Go toolchain cmd/cgo
A discrepancy between how Go and C/C++ comments were parsed allowed for code smuggling into the resulting cgo binary.
AI Analysis
Technical Summary
This vulnerability arises from a parsing discrepancy between Go and C/C++ comments in the cmd/cgo tool, enabling code injection via comment-based code smuggling into the resulting cgo binary. An attacker could exploit this to embed and execute arbitrary code during the build process of Go modules that use cgo. The issue primarily affects systems compiling untrusted Go code with cgo, potentially leading to significant system compromise. Red Hat has issued an important security advisory and released patches in golang 1.25.7 to address this vulnerability.
Potential Impact
Successful exploitation allows an attacker to inject and execute arbitrary code within the compiled cgo binary, leading to high confidentiality, integrity, and availability impacts. This could result in significant system compromise on affected systems where untrusted Go modules using cgo are built. The CVSS v3.1 base score is 8.6 (high severity) with network attack vector, low attack complexity, no privileges required, user interaction required, and scope changed. Red Hat rates the impact as Important for their products.
Mitigation Recommendations
A security update fixing this vulnerability is available in golang version 1.25.7 and later. Users of affected Red Hat Enterprise Linux and OpenShift Container Platform versions should apply the provided patches promptly. Refer to the Red Hat advisory RHSA-2026:3192 for detailed update instructions. No alternative mitigations are specified by the vendor; applying the official fix is the recommended action.
CVE-2025-61732: CWE-94: Improper Control of Generation of Code ('Code Injection') in Go toolchain cmd/cgo
Description
A discrepancy between how Go and C/C++ comments were parsed allowed for code smuggling into the resulting cgo binary.
CVSS v3.1
Score 8.6high
Affected software
Go toolchain
cmd/cgo
pkg:golang/github.com/golang/go/cmd/cgoRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability arises from a parsing discrepancy between Go and C/C++ comments in the cmd/cgo tool, enabling code injection via comment-based code smuggling into the resulting cgo binary. An attacker could exploit this to embed and execute arbitrary code during the build process of Go modules that use cgo. The issue primarily affects systems compiling untrusted Go code with cgo, potentially leading to significant system compromise. Red Hat has issued an important security advisory and released patches in golang 1.25.7 to address this vulnerability.
Potential Impact
Successful exploitation allows an attacker to inject and execute arbitrary code within the compiled cgo binary, leading to high confidentiality, integrity, and availability impacts. This could result in significant system compromise on affected systems where untrusted Go modules using cgo are built. The CVSS v3.1 base score is 8.6 (high severity) with network attack vector, low attack complexity, no privileges required, user interaction required, and scope changed. Red Hat rates the impact as Important for their products.
Mitigation Recommendations
A security update fixing this vulnerability is available in golang version 1.25.7 and later. Users of affected Red Hat Enterprise Linux and OpenShift Container Platform versions should apply the provided patches promptly. Refer to the Red Hat advisory RHSA-2026:3192 for detailed update instructions. No alternative mitigations are specified by the vendor; applying the official fix is the recommended action.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- Go
- Date Reserved
- 2025-09-30T15:05:03.606Z
- State
- PUBLISHED
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2025-61732","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3192","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:2706","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:2708","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3468","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3470","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3489","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3471","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3473","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3472","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3469","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3193","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:2709","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:7385","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:7291","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:12282","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:14100","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:21691","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:15091","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:14774","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:10104","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5907","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:8448","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5133","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:4434","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3855","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:2844","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3559","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3556","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5948","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5950","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:5952","vendor":"Red Hat"}]
Threat ID: 6984194cf9fa50a62fffe422
Added to database: 02/05/2026, 04:15:08 UTC
Last enriched: 08/15/2026, 14:39:52 UTC
Last updated: 09/10/2026, 22:12:33 UTC
Views: 374
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.