8.6
HIGH CVSS 3.1
CVE-2025-61731
Arbitrary file write using cgo pkg-config directive in cmd/go
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.

INFO

Published Date :

Jan. 28, 2026, 8:16 p.m.

Last Modified :

June 30, 2026, 3:16 a.m.

Remotely Exploit :

No
Affected Products

The following products are affected by CVE-2025-61731 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Golang go
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 134c704f-9b21-4f2e-91b3-4a467353bcc0
CVSS 3.1 HIGH 134c704f-9b21-4f2e-91b3-4a467353bcc0
CVSS 3.1 HIGH 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
Solution
Sanitize input for pkg-config directives to prevent arbitrary file writes.
  • Validate input used in '#cgo pkg-config:' directives.
  • Remove or sanitize '--log-file' arguments.
  • Avoid using untrusted input in build directives.
  • Update build tools and dependencies.
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2025-61731.

URL Resource
https://go.dev/cl/736711 Patch
https://go.dev/issue/77100 Issue Tracking
https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc Mailing List Release Notes
https://pkg.go.dev/vuln/GO-2026-4339 Vendor Advisory
https://access.redhat.com/errata/RHSA-2026:12118
https://access.redhat.com/errata/RHSA-2026:12282
https://access.redhat.com/errata/RHSA-2026:13736
https://access.redhat.com/errata/RHSA-2026:14100
https://access.redhat.com/errata/RHSA-2026:14774
https://access.redhat.com/errata/RHSA-2026:15091
https://access.redhat.com/errata/RHSA-2026:20088
https://access.redhat.com/errata/RHSA-2026:21691
https://access.redhat.com/errata/RHSA-2026:3556
https://access.redhat.com/errata/RHSA-2026:3559
https://access.redhat.com/errata/RHSA-2026:3855
https://access.redhat.com/errata/RHSA-2026:4434
https://access.redhat.com/errata/RHSA-2026:5133
https://access.redhat.com/errata/RHSA-2026:5907
https://access.redhat.com/errata/RHSA-2026:5941
https://access.redhat.com/errata/RHSA-2026:5942
https://access.redhat.com/errata/RHSA-2026:5943
https://access.redhat.com/errata/RHSA-2026:5944
https://access.redhat.com/errata/RHSA-2026:5948
https://access.redhat.com/errata/RHSA-2026:5950
https://access.redhat.com/errata/RHSA-2026:5952
https://access.redhat.com/errata/RHSA-2026:6949
https://access.redhat.com/errata/RHSA-2026:7291
https://access.redhat.com/errata/RHSA-2026:7385
https://access.redhat.com/errata/RHSA-2026:7833
https://access.redhat.com/errata/RHSA-2026:7834
https://access.redhat.com/errata/RHSA-2026:7876
https://access.redhat.com/errata/RHSA-2026:7877
https://access.redhat.com/errata/RHSA-2026:7878
https://access.redhat.com/errata/RHSA-2026:7879
https://access.redhat.com/errata/RHSA-2026:7883
https://access.redhat.com/security/cve/CVE-2025-61731
https://bugzilla.redhat.com/show_bug.cgi?id=2434433
https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-61731.json
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2025-61731 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2025-61731 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2025-61731 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by 0b0ca135-0b70-47e7-9f44-1890c2a1c46c

    Jun. 30, 2026

    Action Type Old Value New Value
    Added Affected [{'cpes': ['cpe:/o:redhat:enterprise_linux_eus:10.0'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream EUS (v. 10.0)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/o:redhat:enterprise_linux:10.1'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream (v. 10)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:enterprise_linux:8::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream (v. 8)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_aus:8.2::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream AUS (v. 8.2)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_aus:8.4::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream AUS (v.8.4)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_eus_long_life:8.4::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream EUS EXTENSION (v.8.4)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_aus:8.6::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream AUS (v.8.6)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_e4s:8.6::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream E4S (v.8.6)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_tus:8.6::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream TUS (v.8.6)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_e4s:8.8::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream E4S (v.8.8)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_tus:8.8::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream TUS (v.8.8)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_e4s:9.0::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream E4S (v.9.0)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_e4s:9.2::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream E4S (v.9.2)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_eus:9.4::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream EUS (v.9.4)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:rhel_eus:9.6::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream EUS (v.9.6)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:enterprise_linux:9::appstream'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux AppStream (v. 9)', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:hummingbird:1'], 'vendor': 'Red Hat', 'product': 'Red Hat Hardened Images', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.12::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.12', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.13::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.13', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.14::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.14', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.15::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.15', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.16::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.16', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.17::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.17', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.18::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.18', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.19::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.19', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:openshift:4.20::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Container Platform 4.20', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:service_mesh:2.6::el8'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Service Mesh 2.6', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:service_mesh:3.0::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Service Mesh 3.0', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:service_mesh:3.1::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Service Mesh 3.1', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:service_mesh:3.2::el9'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Service Mesh 3.2', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/o:redhat:enterprise_linux:8'], 'vendor': 'Red Hat', 'product': 'Red Hat Enterprise Linux 8', 'defaultStatus': 'affected'}, {'cpes': ['cpe:/a:redhat:container_native_virtualization:4'], 'vendor': 'Red Hat', 'product': 'Red Hat OpenShift Virtualization 4', 'defaultStatus': 'affected'}]
    Added CVSS V3.1 AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
    Added CWE CWE-88
    Added Reference https://access.redhat.com/errata/RHSA-2026:12118
    Added Reference https://access.redhat.com/errata/RHSA-2026:12282
    Added Reference https://access.redhat.com/errata/RHSA-2026:13736
    Added Reference https://access.redhat.com/errata/RHSA-2026:14100
    Added Reference https://access.redhat.com/errata/RHSA-2026:14774
    Added Reference https://access.redhat.com/errata/RHSA-2026:15091
    Added Reference https://access.redhat.com/errata/RHSA-2026:20088
    Added Reference https://access.redhat.com/errata/RHSA-2026:21691
    Added Reference https://access.redhat.com/errata/RHSA-2026:3556
    Added Reference https://access.redhat.com/errata/RHSA-2026:3559
    Added Reference https://access.redhat.com/errata/RHSA-2026:3855
    Added Reference https://access.redhat.com/errata/RHSA-2026:4434
    Added Reference https://access.redhat.com/errata/RHSA-2026:5133
    Added Reference https://access.redhat.com/errata/RHSA-2026:5907
    Added Reference https://access.redhat.com/errata/RHSA-2026:5941
    Added Reference https://access.redhat.com/errata/RHSA-2026:5942
    Added Reference https://access.redhat.com/errata/RHSA-2026:5943
    Added Reference https://access.redhat.com/errata/RHSA-2026:5944
    Added Reference https://access.redhat.com/errata/RHSA-2026:5948
    Added Reference https://access.redhat.com/errata/RHSA-2026:5950
    Added Reference https://access.redhat.com/errata/RHSA-2026:5952
    Added Reference https://access.redhat.com/errata/RHSA-2026:6949
    Added Reference https://access.redhat.com/errata/RHSA-2026:7291
    Added Reference https://access.redhat.com/errata/RHSA-2026:7385
    Added Reference https://access.redhat.com/errata/RHSA-2026:7833
    Added Reference https://access.redhat.com/errata/RHSA-2026:7834
    Added Reference https://access.redhat.com/errata/RHSA-2026:7876
    Added Reference https://access.redhat.com/errata/RHSA-2026:7877
    Added Reference https://access.redhat.com/errata/RHSA-2026:7878
    Added Reference https://access.redhat.com/errata/RHSA-2026:7879
    Added Reference https://access.redhat.com/errata/RHSA-2026:7883
    Added Reference https://access.redhat.com/security/cve/CVE-2025-61731
    Added Reference https://bugzilla.redhat.com/show_bug.cgi?id=2434433
    Added Reference https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-61731.json
  • CVE Modified by [email protected]

    Jun. 17, 2026

    Action Type Old Value New Value
    Added Affected [{'vendor': 'Go toolchain', 'product': 'cmd/go', 'versions': [{'status': 'affected', 'version': '0', 'lessThan': '1.24.12', 'versionType': 'semver'}, {'status': 'affected', 'version': '1.25.0', 'lessThan': '1.25.6', 'versionType': 'semver'}], 'packageName': 'cmd/go', 'collectionURL': 'https://pkg.go.dev', 'defaultStatus': 'unaffected'}]
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Jun. 17, 2026

    Action Type Old Value New Value
    Added SSVC {'id': 'CVE-2025-61731', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-01-29T04:55:56.484332Z'}
  • Initial Analysis by [email protected]

    Feb. 06, 2026

    Action Type Old Value New Value
    Added CWE NVD-CWE-noinfo
    Added CPE Configuration OR *cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* versions up to (excluding) 1.24.12 *cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* versions from (including) 1.25.0 up to (excluding) 1.25.6
    Added Reference Type Go Project: https://go.dev/cl/736711 Types: Patch
    Added Reference Type Go Project: https://go.dev/issue/77100 Types: Issue Tracking
    Added Reference Type Go Project: https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc Types: Mailing List, Release Notes
    Added Reference Type Go Project: https://pkg.go.dev/vuln/GO-2026-4339 Types: Vendor Advisory
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Jan. 29, 2026

    Action Type Old Value New Value
    Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • New CVE Received by [email protected]

    Jan. 28, 2026

    Action Type Old Value New Value
    Added 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.
    Added Reference https://go.dev/cl/736711
    Added Reference https://go.dev/issue/77100
    Added Reference https://groups.google.com/g/golang-announce/c/Vd2tYVM8eUc
    Added Reference https://pkg.go.dev/vuln/GO-2026-4339
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.