CVE Catalog

CVE-2025-61731

HighCVSS 7.8
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.55%

44th percentile - higher than 44% of all known CVEs

Summary

A vulnerability in the cmd/go tool allows writing 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 the pkg-config command. An attacker can supply a "--log-file" argument to this directive, causing pkg-config to write to an attacker-controlled location.

Risk Assessment

The risk is that an attacker can overwrite or create files in arbitrary locations, potentially leading to privilege escalation, system configuration modification, or other malicious activities.

Recommendation

It is recommended to immediately update the cmd/go tool to a version that includes a fix for this vulnerability. Also, avoid using untrusted Go source files with the "#cgo pkg-config:" directive.

Related vulnerabilities

Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS