Arbitrary file write using cgo pkg-config directive in cmd/go
CVE-2025-61731Published 28 Jan 2026, 19:30 UTC
Real-world risk
4.3/ 10Medium
Schedule in the normal cycle
PreliminaryFrom the CVSS vector only · confidence low
CVSS
7.8
scored by CISA, CVSS 3.1
In plain words
No plain-language summary yet. The original description is below.
Original description (from Go)
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.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| cmd/goNiche | < 1.24.12; >= 1.25.0, < 1.25.6 | 1.24.12, 1.25.6 |
What to do
Update to a fixed version: 1.24.12, 1.25.6.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Full compromiseCode execution or full control of the system or application | From the CVSS vector | 1.00 |
| Attacker position | LocalMust already run code or have a shell on the machine | From the CVSS vector | 0.50 |
| Privileges needed | LowA real low-privileged account | From the CVSS vector | 1.00 |
| Victim interaction | NoneNothing | From the CVSS vector | 1.00 |
| Configuration | DefaultOut-of-the-box installs are vulnerable | From the CVSS vector | 1.00 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.6% chance of exploitation in 30 days (percentile 50), as of 2026-12-05.
The arithmetic
- Prerequisites multiplied together0.500
- Threat T1: Nothing known0.850
- 10 × impact 1 × prerequisites 0.5 × threat 0.854.250
- Rounded to one decimal between 0.1 and 104.3
Exploitation and evidence timeline
- 28 Jan 2026 Published
- 3 Dec 2026 Risk 4.3 (cvss fallback)
Weakness
CWE-78
References
- https://go.dev/cl/736711
- https://go.dev/issue/77100
- https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc
- https://pkg.go.dev/vuln/GO-2026-4339
- https://access.redhat.com/security/cve/CVE-2025-61731redhat, vdb-entry
- https://bugzilla.redhat.com/show_bug.cgi?id=2434433issue-tracking, redhat
- https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-61731.jsonx-sadp-csaf-vex
- https://access.redhat.com/errata/RHSA-2026:5943redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5941redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:6949redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7878redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7879redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7876redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7877redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7883redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7833redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7834redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5944redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5942redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7385redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:7291redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:12282redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:14100redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:21691redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:15091redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:14774redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:20088redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:17598redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:12118redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:8448redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:13736redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:4434redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:3855redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:3559redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:3556redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5948redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5950redhat, vendor-advisory
- https://access.redhat.com/errata/RHSA-2026:5952redhat, vendor-advisory
- CVE-2025-61731 on CVE.org