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.

References
Link Providers
https://access.redhat.com/errata/RHSA-2026:12118 cve-icon
https://access.redhat.com/errata/RHSA-2026:12282 cve-icon
https://access.redhat.com/errata/RHSA-2026:13736 cve-icon
https://access.redhat.com/errata/RHSA-2026:14100 cve-icon
https://access.redhat.com/errata/RHSA-2026:14774 cve-icon
https://access.redhat.com/errata/RHSA-2026:15091 cve-icon
https://access.redhat.com/errata/RHSA-2026:17598 cve-icon
https://access.redhat.com/errata/RHSA-2026:20088 cve-icon
https://access.redhat.com/errata/RHSA-2026:21691 cve-icon
https://access.redhat.com/errata/RHSA-2026:3556 cve-icon
https://access.redhat.com/errata/RHSA-2026:3559 cve-icon
https://access.redhat.com/errata/RHSA-2026:3855 cve-icon
https://access.redhat.com/errata/RHSA-2026:4434 cve-icon
https://access.redhat.com/errata/RHSA-2026:5941 cve-icon
https://access.redhat.com/errata/RHSA-2026:5942 cve-icon
https://access.redhat.com/errata/RHSA-2026:5943 cve-icon
https://access.redhat.com/errata/RHSA-2026:5944 cve-icon
https://access.redhat.com/errata/RHSA-2026:5948 cve-icon
https://access.redhat.com/errata/RHSA-2026:5950 cve-icon
https://access.redhat.com/errata/RHSA-2026:5952 cve-icon
https://access.redhat.com/errata/RHSA-2026:6949 cve-icon
https://access.redhat.com/errata/RHSA-2026:7291 cve-icon
https://access.redhat.com/errata/RHSA-2026:7385 cve-icon
https://access.redhat.com/errata/RHSA-2026:7833 cve-icon
https://access.redhat.com/errata/RHSA-2026:7834 cve-icon
https://access.redhat.com/errata/RHSA-2026:7876 cve-icon
https://access.redhat.com/errata/RHSA-2026:7877 cve-icon
https://access.redhat.com/errata/RHSA-2026:7878 cve-icon
https://access.redhat.com/errata/RHSA-2026:7879 cve-icon
https://access.redhat.com/errata/RHSA-2026:7883 cve-icon
https://access.redhat.com/errata/RHSA-2026:8448 cve-icon
https://access.redhat.com/security/cve/CVE-2025-61731 cve-icon
https://bugzilla.redhat.com/show_bug.cgi?id=2434433 cve-icon
https://go.dev/cl/736711 cve-icon cve-icon cve-icon
https://go.dev/issue/77100 cve-icon cve-icon cve-icon
https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc cve-icon cve-icon cve-icon
https://nvd.nist.gov/vuln/detail/CVE-2025-61731 cve-icon
https://pkg.go.dev/vuln/GO-2026-4339 cve-icon cve-icon cve-icon
https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-61731.json cve-icon
https://www.cve.org/CVERecord?id=CVE-2025-61731 cve-icon
History

Fri, 06 Feb 2026 18:45:00 +0000

Type Values Removed Values Added
First Time appeared Golang
Golang go
Weaknesses NVD-CWE-noinfo
CPEs cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*
Vendors & Products Golang
Golang go

Thu, 05 Feb 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-88
References
Metrics threat_severity

None

threat_severity

Important


Thu, 29 Jan 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 29 Jan 2026 10:15:00 +0000

Type Values Removed Values Added
First Time appeared Gotoolchain
Gotoolchain cmd/go
Vendors & Products Gotoolchain
Gotoolchain cmd/go

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-08-10T12:05:40.340Z

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

Link: CVE-2025-61731

cve-icon Vulnrichment

Updated: 2026-08-10T12:05:40.340Z

cve-icon NVD

Status : Modified

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

Modified: 2026-08-10T13:17:34.380

Link: CVE-2025-61731

cve-icon Redhat

Severity : Important

Publid Date: 2026-01-28T19:30:30Z

Links: CVE-2025-61731 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-01-29T09:08:43Z

Weaknesses