cmd/go: Arbitrary file write via malicious pkg-config directive
CVE: CVE-2025-61731
Component: cmd/go
CWE: CWE-88
Severity: Important
CVSS v3: 8.5/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Release date: 2025-01-01T00:00:00+00:00

A flaw was found in cmd/go. An attacker can exploit this by building a malicious Go source file that uses the '#cgo pkg-config:' directive. This allows the attacker to write to an arbitrary file with partial control over its content, by providing a '--log-file' argument to the pkg-config command. This vulnerability can lead to arbitrary file write.

Statement: This vulnerability is Important rather than Moderate because compiling a malicious Go source file can cause `pkg-config` to create or append data to files at attacker-chosen locations, subject to the permissions of the build user. This can enable unintended filesystem modifications during the build process, which can lead to broken builds, alter tool behavior, and poison caches or artifacts, even without direct code execution.

Remediation:
For OpenShift Container Platform 4.19 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update:

https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/release_notes/

You may download the oc tool and use it to inspect release image metadata for x86_64, s390x, ppc64le, and aarch64 architectures. The image digests may be found at https://quay.io/repository/openshift-release-dev/ocp-release?tab=tags.

The sha values for the release are as follows:

      (For x86_64 architecture)
      The image digest is sha256:64d312cc715ccb58e44b7ed0a7a1a24ad407b72be2cb865512f9bf8ff7578524

      (For s390x architecture)
      The image digest is sha256:d597607d81ec8146b6403a37d48605c34c0649cffdd5b9a532936d71e7c02d81

      (For ppc64le architecture)
      The image digest is sha256:ce22c81cb59efaad506ed4c0222611d8ed603a597cca876e1ab87f4ff94523da

      (For aarch64 architecture)
      The image digest is sha256:d09f3caab920c99068212112676f4a8c2e7f3ee72f69d69ead2ec90e8918213b

All OpenShift Container Platform 4.19 users are advised to upgrade to these updated packages and images when they are available in the appropriate release channel. To check for available updates, use the OpenShift CLI (oc) or web console. Instructions for upgrading a cluster are available at https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html-single/updating_clusters/index#updating-cluster-cli.
For OpenShift Container Platform 4.20 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update:

https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/release_notes/

You may download the oc tool and use it to inspect release image metadata for x86_64, s390x, ppc64le, and aarch64 architectures. The image digests may be found at https://quay.io/repository/openshift-release-dev/ocp-release?tab=tags.

The sha values for the release are as follows:

      (For x86_64 architecture)
      The image digest is sha256:5e2fb7977a82237e497443e2bb53fd1c196e083fc5095294699399b61ce02746

      (For s390x architecture)
      The image digest is sha256:dfc309cca8f14d497793502deace618448e55a97686b49793034a16e014a5843

      (For ppc64le architecture)
      The image digest is sha256:097c91d50e665781b82929c57911fff13b453d1ef3ee1759d84a0ce88da8e03b

      (For aarch64 architecture)
      The image digest is sha256:665bd6fff9282786782e17b6b70520e798087d06eaa840e0bb37e2ed3a9ac59e

All OpenShift Container Platform 4.20 users are advised to upgrade to these updated packages and images when they are available in the appropriate release channel. To check for available updates, use the OpenShift CLI (oc) or web console. Instructions for upgrading a cluster are available at https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html-single/updating_clusters/index#updating-cluster-cli.
See Red Hat OpenShift Service Mesh 2.6.14 documentation at https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/service_mesh/service-mesh-2-x
See Red Hat OpenShift Service Mesh 2.6.14 documentation at https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/service_mesh/service-mesh-2-x
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.