High severity · published Jan 28, 2026
CVE-2025-61731
Arbitrary file write using cgo pkg-config directive in cmd/go
7.8
CVSS
0.6%
EPSS
No
On KEV
Description
Building a malicious file with cmd/go can cause can cause a write to an attacker-controlled file with partial control of the file content. The "#cgo pkg-config:" directive in a Go source file provides command-line arguments to provide to the Go pkg-config command. An attacker can provide a "--log-file" argument to this directive, causing pkg-config to write to an attacker-controlled location.
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.6% · higher than 49% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CM
cmd/go · Go toolchain
before 1.24.12; 1.25.0 before 1.25.6 · source: vendor
GO
GO · Golang
before 1.24.12; 1.25.0 before 1.25.6 · source: NVD
RH
Red Hat Enterprise Linux 10 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 10.0 Extended Update Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8 · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.2 Advanced Update Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.6 Telecommunications Update Service · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions · Red Hat
All versions, or not specified · source: CISA
RH
Red Hat Enterprise Linux 8.8 Telecommunications Update Service · Red Hat
All versions, or not specified · source: CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2025-61731
CVE.org
https://www.cve.org/CVERecord?id=CVE-2025-61731
Patch
https://go.dev/cl/736711
Issue Tracking
https://go.dev/issue/77100
Mailing List
https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc
Vendor Advisory
https://pkg.go.dev/vuln/GO-2026-4339
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:12118
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:12282
More from cmd/go
8.8
CVE-2026-27140
Code execution vulnerability in SWIG code generation in cmd/go
8.8
CVE-2024-45340
GOAUTH credential leak in cmd/go
8.6
CVE-2025-4674
Unexpected command execution in untrusted VCS repositories in cmd/go
8.4
CVE-2026-56865
Fix transparency log tile verification bypass in golang.org/x/mod/sumdb/tlog
7.8
CVE-2026-94447
Checksum database bypass for golang.org/toolchain in cmd/go
