CVE-2025-61731
Arbitrary file write using cgo pkg-config directive in cmd/go
7.8CVSSHIGH
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 Breakdown
Exploitability
AV:LAttack VectorLocal
AC:LAttack ComplexityLow
PR:LPrivileges RequiredLow
UI:NUser InteractionNone
Scope
S:UScopeUnchanged
Impact
C:HConfidentialityHigh
I:HIntegrityHigh
A:HAvailabilityHigh
Weaknesses
Affected Products
Exploitability
Official Patch Available
References
https://go.dev/cl/736711
go.dev
https://go.dev/issue/77100
go.dev
https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc
groups.google.com
and 7 more references View all →
Timeline
Published
Jan 28, 2026
Last Updated
Feb 6, 2026
Unlock Complete Vulnerability Intelligence
Get the full picture for CVE-2025-61731 and every CVE in our database. Create a free account — no credit card required.
Create Free AccountPlain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows