LiveActive security incident?Get immediate response
CVE Record

CVE-2025-61731: Arbitrary file write using cgo pkg-config directive in cmd/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.

HighCVSS 8.6Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious Go source file can misuse a cgo build directive to make pkg-config write partially controlled content to an attacker-chosen file. Exploitation requires someone or an automated build system to build the malicious source. Successful abuse could compromise sensitive files and the broader build environment.

Executive priority

Treat this as a high-priority build-chain issue where teams compile third-party or untrusted Go code. Prioritize shared CI infrastructure and privileged build systems because an attacker-controlled file write could affect other workloads, credentials, or produced artifacts. Internet-facing emergency treatment is not supported by the supplied evidence.

Technical view

CVE-2025-61731 is command-line argument injection in cmd/go’s handling of “#cgo pkg-config:” directives. An attacker can supply a “--log-file” argument, directing pkg-config to write partially controlled content to an attacker-selected path. The supplied CVSS 3.1 score is 8.6, with CWE-78 and CWE-88 classifications.

Likely exposure

Exposure is concentrated in developer workstations, CI runners, build containers, and services that compile untrusted or newly introduced Go source using cgo and pkg-config. Systems that do not build such source are less likely to be directly exposed. The supplied version data does not clearly define the complete affected range.

Exploitation context

The vulnerability requires a malicious file to be built, so it is not described as direct remote exploitation. KEV is false, and the supplied sources provide no evidence of active exploitation in the wild.

Researcher notes

The core primitive is argument injection from a cgo directive into pkg-config, producing an arbitrary-path write with only partial content control. The structured affected entry lists versions “0” and “1.25.0” while stating a default status of unaffected; therefore, confirm the precise vulnerable and fixed version boundaries through the official advisories.

Mitigation direction

  • Apply the Go toolchain update identified by official Go guidance; the supplied bundle does not state the fixed version.
  • Apply applicable Red Hat errata to Red Hat-managed build hosts and images.
  • Until remediated, avoid building untrusted Go source that uses cgo pkg-config directives.
  • Run builds with least privilege and isolate writable paths from sensitive host locations.

Validation and detection

  • Inventory Go toolchain versions across developer workstations, CI runners, build containers, and ephemeral build environments.
  • Compare each version and operating-system package against the official Go advisory and applicable vendor errata.
  • Review repositories and dependencies for cgo pkg-config directives, prioritizing code from untrusted or newly introduced sources.
  • Investigate unexpected file writes associated with Go builds or pkg-config execution.
  • Confirm updated build environments complete representative builds without unexpected filesystem changes.
Prepared
Confidence
medium
Sources
9

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-78: Command execution behavior lookup

Command injection weaknesses can lead defenders to review execution techniques and command interpreter telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-88: Command execution behavior lookup

Command injection weaknesses can lead defenders to review execution techniques and command interpreter telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

File access behavior lookup

The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2025-61731 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.6 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
39Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.6CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H1.86redhat-SADP
7.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H1.85.9CISA-ADP

Vulnerability scoring details

Base CVSS 3.1 score

8.6High
CVSS 3.1 vector shape for CVE-2025-61731Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
cvssV3_1other:ssvc
redhat-SADPcmd/go: cmd/go: Arbitrary file write via malicious pkg-config directive
other:Red Hat severity ratingcvssV3_1
  • 2026-01-28T20:01:45.587Z: Reported to Red Hat.
  • 2026-01-28T19:30:30.844Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
Go toolchaincmd/gocmd/go, 0, 1.25.0unaffected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.