CVE-2025-61731

HIGHCVSS 7.8/10EPSS 0.36%

Last modified

CVE-2025-61731 is a high-severity vulnerability rated 7.8/10 on the CVSS scale. 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. EPSS estimates a 0.36% chance of exploitation in the next 30 days.

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.

Metrics

CVSS 3.1
7.8/10

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

EPSS Probability
0.36%

27.8th percentile

Probability of exploitation in the next 30 days. Learn more

Affected Software

VendorProductVersions
GolangGo< 1.24.12
GolangGo>= 1.25.0, < 1.25.6

References

Timeline

Published
Last Modified
Status
Analyzed

Frequently Asked Questions

What is CVE-2025-61731?
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.
How severe is CVE-2025-61731?
CVE-2025-61731 has a CVSS score of 7.8/10 (HIGH severity). The EPSS model estimates a 0.36% probability of exploitation in the next 30 days.
How do I fix CVE-2025-61731?
Check the vendor references and advisories linked above for patched versions and mitigation guidance. You can also run a Strix scan to test if your systems are affected.

Are you affected by CVE-2025-61731?

Run a free Strix scan to check your systems for this vulnerability.

Scan your code now

Source: NVD / NIST