Arbitrary file write using cgo pkg-config directive in cmd/go
Vulnerability 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.
Impact Analysis
Refer to official advisory for detailed impact metrics.
Remediation
Ensure systems are updated to the latest vendor-supplied patch levels.
Am I Vulnerable?
Launch our assessment wizard to check if your infrastructure is exposed to • CVE-2025-61731
Credits & Attribution
The following person or organization is credited with identifying this vulnerability, as recorded in the NVD database:
- RyotaK (https://ryotak.net) of GMO Flatt Security Inc.
References
More from Go toolchain
View All →Affected Vendor
Go toolchain
View all reports →Affected Software
Timeline
CVSS Vectors
Weaknesses (CWE)
No CWE data available
MITRE ATT&CK TTPs
No associated TTPs found for this vulnerability.