CVE-2025-61731
Arbitrary file write using cgo pkg-config directive in cmd/go
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.
No summary for this CVE yet.
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
Go toolchain
oss-project·USaka golang, cmd/go, go compiler toolchain
cmd/goLibrary
OSS Libraries / gogolang
oss-project·US
ООО «Ред Софт»
commercial·RUaka red soft
The Go Project
oss-projectaka golang-google-protobuf, go, crypto
Exploitability
Official Patch Available
Attack Graph
Products CVE Techniques Tactics
Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/⌘ + scroll to zoom, or go fullscreen.
MITRE ATT&CK
1 technique Execution
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 41 more references View all →
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
