CVE-2025-61731

published 28 Jan 2026 · updated 16 Nov 2026

Arbitrary file write using cgo pkg-config directive in cmd/go

7.8HighCVSS 7.8EPSS 1%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in 1.24.12 and 1.25.6.

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.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Go toolchain<1.24.12, >=1.25.0 <1.25.61.24.12, 1.25.6

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2025-61731 severity on Zeptric[![CVE-2025-61731](https://zeptric.io/badge/cve/CVE-2025-61731.svg)](https://zeptric.io/cve/CVE-2025-61731)