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.
Advisories

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Wed, 28 Jan 2026 19:45:00 +0000

Type Values Removed Values Added
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.
Title Arbitrary file write using cgo pkg-config directive in cmd/go
References

Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: Go

Published:

Updated: 2026-01-28T19:30:30.844Z

Reserved: 2025-09-30T15:05:03.605Z

Link: CVE-2025-61731

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-01-28T20:16:10.073

Modified: 2026-01-28T20:16:10.073

Link: CVE-2025-61731

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.

Weaknesses

No weakness.