Cyber Resilience

CVE-2025-61731

Golang Go ≤ 1.24.12

Published
28 January 2026
Modified
10 August 2026
Patch / advisory
CVSS Score v3.1 7.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0053 42th percentile
Risk Priority 57 floored blend · peak EPSS

Summary

CVE-2025-61731 is a high-severity Argument Injection (CWE-88) vulnerability in Golang Go. Its CVSS base score is 7.8 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Command and Scripting Interpreter (T1059); ranked at the 42th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2025-61731 affects the cmd/go tool in the Go programming language. The vulnerability arises when building a Go source file that includes a malicious "#cgo pkg-config:" directive. This directive passes command-line arguments to the pkg-config command, and an attacker can include a "--log-file" argument to direct pkg-config to write log data to an attacker-controlled file location, granting partial control over the written content.

A local attacker with low privileges can exploit this issue by tricking a user into building a malicious Go source file. Exploitation requires local access and low complexity with no user interaction needed. Successful attacks enable arbitrary file writes, resulting in high impacts to confidentiality, integrity, and availability, as reflected in the CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Go advisories detail mitigations and patches, including the fix in change list https://go.dev/cl/736711, issue discussion at https://go.dev/issue/77100, announcement at https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc, and vulnerability entry at https://pkg.go.dev/vuln/GO-2026-4339.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

pkg-config command. An attacker can provide a "--log-file" argument to this directive, causing pkg-config to write to an attacker-controlled location.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.003 Windows Command Shell Execution
Adversaries may abuse the Windows command shell for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-24540Same product: Golang Go
CVE-2023-24538Same product: Golang Go
CVE-2023-39320Same product: Golang Go
CVE-2025-61732Same product: Golang Go
CVE-2023-24539Same product: Golang Go
CVE-2023-29400Same product: Golang Go
CVE-2026-39826Same product: Golang Go
CVE-2026-32289Same product: Golang Go
CVE-2026-42505Same product: Golang Go
CVE-2025-58188Same product: Golang Go

Affected Assets

golang
go
≤ 1.24.12 · 1.25.0 — 1.25.6

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.2.5

Mitigating Controls (NIST 800-53 r5) AI

Developer testing can discover argument-injection flaws in command-construction code but does not stop their introduction.

Input validation directly stops construction of command strings containing unneutralized delimiters or injected arguments.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require proper input validation and command construction to prevent argument injection.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect argument injection but does not prevent it at the source.

prevents

Secure development lifecycle mandates input validation and command construction practices that directly prevent argument injection.

prevents

Application security requirements include explicit rules for safe command-line argument handling and escaping.

prevents

Secure architecture principles discourage unsafe command invocation patterns and favor safer APIs.

prevents

Secure coding standards explicitly require proper neutralization of command arguments, directly eliminating CWE-88.

none

Change management can catch unsafe command patterns during reviews but is not a direct mitigation.

References