Skip to main content
CVE-2025-61731VulnerabilityPublished Updated

CVE-2025-61731: Go toolchain cmd/go · OS Command Injection

Affects Go toolchain cmd/goSource CVE Database V5

0

Not known to be exploited · CVSS 7.8 High : upgrade to 1.25.6 or 1.24.12 soon.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 3.1 base score
7.8High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.6% chance of exploitation in 30 days – higher than 48% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 1.25.6, 1.24.12
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 28 Jan 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Upgrade Go toolchain cmd/go to 1.25.6 or 1.24.12.

Affected software

ProductAffectedFixed in
Go toolchaincmd/goAffected
  • <1.24.12
  • >=1.25.0 <1.25.6
Fixed in
  • 1.25.6
  • 1.24.12
Gocmd/gopkg:golang/cmd/goOther threatsAffected
  • <1.24.12
  • >=1.25.0 <1.25.6
Fixed in
  • 1.24.12
  • 1.25.6

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Red Hat has released updated golang packages that fix this vulnerability. Users should apply these security updates as soon as possible. Currently, no effective mitigations meet Red Hat's criteria for ease of use and deployment. Until patched, restricting build permissions and limiting untrusted source builds may reduce risk. Refer to Red Hat advisory RHSA-2026:5943 for update instructions.

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.

References

Community reviews

Loading reviews…