Vulnerability · Published Jan 28, 2026 · Assigned by Go

CVE-2025-61731Arbitrary file write using cgo pkg-config directive in cmd/go

High 7.8

In plain English

A high-severity argument injection in cmd/go from Go toolchain. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 49% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.6%top 50.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8delve1.25.2-1.module_el8.10.0+4074+24330916ALSA-2026:6949
AlmaLinux:8go-toolset1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9go-toolset1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:8golang1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:8golang-bin1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-bin1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:10golang-docs1.25.8-1.el10_1.alma.1ALSA-2026:5941
AlmaLinux:8golang-docs1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-docs1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:10golang-misc1.25.8-1.el10_1.alma.1ALSA-2026:5941
AlmaLinux:8golang-misc1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-misc1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:8golang-race1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-race1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:10golang-src1.25.8-1.el10_1.alma.1ALSA-2026:5941
AlmaLinux:8golang-src1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-src1.25.8-1.el9_7ALSA-2026:5942
AlmaLinux:10golang-tests1.25.8-1.el10_1.alma.1ALSA-2026:5941
AlmaLinux:8golang-tests1.25.8-1.module_el8.10.0+4156+92f0ae2fALSA-2026:6949
AlmaLinux:9golang-tests1.25.8-1.el9_7ALSA-2026:5942
Alpine:v3.23etcd3.6.8-r0ALPINE-CVE-2025-61731
Alpine:v3.24etcd3.6.8-r0ALPINE-CVE-2025-61731
Alpine:v3.22go1.24.12-r0ALPINE-CVE-2025-61731
Alpine:v3.23go1.25.6-r0ALPINE-CVE-2025-61731
Alpine:v3.24go1.25.6-r0ALPINE-CVE-2025-61731
Debian:12golang-1.19no fix listedDEBIAN-CVE-2025-61731
Debian:13golang-1.24no fix listedDEBIAN-CVE-2025-61731
Gotoolchain1.24.12, 1.25.6GO-2026-4339
Rocky Linux:8delve0:1.25.2-1.module+el8.10.0+40035+ee0a7047RLSA-2026:6949
Rocky Linux:10golang0:1.25.8-1.el10_1RLSA-2026:5941
Rocky Linux:9golang0:1.25.8-1.el9_7RLSA-2026:5942
Ubuntu:22.04:LTSgolang-1.17no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.18no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.20no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.21no fix listedUBUNTU-CVE-2025-61731
Ubuntu:24.04:LTSgolang-1.21no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.22no fix listedUBUNTU-CVE-2025-61731
Ubuntu:24.04:LTSgolang-1.22no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-61731
Ubuntu:24.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-61731
Ubuntu:25.10golang-1.23no fix listedUBUNTU-CVE-2025-61731
Ubuntu:26.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-61731
Ubuntu:24.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-61731
Ubuntu:25.10golang-1.24no fix listedUBUNTU-CVE-2025-61731
Ubuntu:26.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-61731
Ubuntu:22.04:LTSgolang-1.25no fix listedUBUNTU-CVE-2025-61731
Ubuntu:24.04:LTSgolang-1.25no fix listedUBUNTU-CVE-2025-61731
Ubuntu:25.10golang-1.25no fix listedUBUNTU-CVE-2025-61731

Affected products (as reported)

VendorProductVersions
Go toolchain cmd/go 0 – before 1.24.121.25.0 – before 1.25.6

Weakness: CWE-88 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References