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 cause the Go build process to write data to an attacker-chosen file path through cgo pkg-config handling. The main business risk is compromised developer or CI build environments, especially where untrusted code is built.

Executive priority

Prioritize remediation for engineering and CI systems that compile untrusted Go code. Runtime-only systems are less directly exposed unless they also include build tooling or package-building workflows.

Technical view

cmd/go passes arguments from the "#cgo pkg-config:" directive to Go's pkg-config handling. Provided sources state an attacker can supply a "--log-file" argument, causing pkg-config to write partially controlled content to an attacker-controlled location during build.

Likely exposure

Exposure is most likely in developer workstations, CI systems, package builders, and automation that build Go source with cgo/pkg-config enabled, especially from pull requests, forks, third-party modules, or untrusted archives.

Exploitation context

The CVSS vector is local with required user interaction, low complexity, no privileges, and changed scope. The provided bundle does not show KEV listing or active exploitation evidence, so active exploitation should not be claimed.

Researcher notes

The issue is an arbitrary file write during build, with only partial control of written content described. Sources identify cmd/go and cgo pkg-config directive handling; they do not provide complete affected-version or fixed-version detail in the bundle.

Mitigation direction

  • Apply applicable Go toolchain or OS vendor updates from Go and Red Hat guidance.
  • Check GO-2026-4339 and vendor advisories for fixed package versions.
  • Avoid building untrusted Go source in privileged or broadly writable environments.
  • Run untrusted builds in isolated, disposable CI workers with least privilege.
  • Restrict cgo/pkg-config use where it is not required.

Validation and detection

  • Inventory Go toolchain versions used by developers, CI, and package builders.
  • Identify pipelines that build untrusted Go source, forks, or third-party modules.
  • Confirm whether cgo and pkg-config are enabled in affected build paths.
  • Compare installed packages against Go vulnerability guidance and Red Hat errata.
  • Review build worker permissions and sensitive writable paths.
Prepared
Confidence
medium
Sources
12

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.

CWE-78 · source CWE mapping

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-88 · source CWE mapping

Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.