Описание
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
A flaw was found in cmd/go. This vulnerability allows an attacker to achieve arbitrary code execution when a user or automated system compiles an untrusted Go package. Due to insufficient validation of package configuration directives (#cgo pkg-config:), an attacker can supply crafted directives that load untrusted configuration files or inject unauthorized compiler and linker flags during the build process.
Отчет
This vulnerability is rated as Moderate impact because arbitrary code execution cannot occur automatically and requires explicit user interaction to fetch and compile an untrusted Go project. In typical Red Hat Enterprise Linux and containerized developer environments, the Go toolchain functions as a local build utility rather than an exposed listening network service. Consequently, the attack surface is limited to development workstations and continuous integration pipelines that process unverified external source code.
Меры по смягчению последствий
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.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Exploit Intelligence | exploit-intelligence/vulnerability-analysis-rhel9 | Affected | ||
| Migration Toolkit for Applications 8 | mta/mta-go-external-provider-rhel9 | Affected | ||
| Red Hat Hardened Images | golang1.25 | Will not fix | ||
| Red Hat OpenShift Container Platform 4 | openshift4/ose-operator-sdk-rhel8 | Affected | ||
| Red Hat OpenShift Container Platform 4 | openshift4/ose-operator-sdk-rhel9 | Affected | ||
| Red Hat OpenShift Dev Spaces | devspaces/udi-rhel9 | Affected | ||
| Red Hat Enterprise Linux 10 | golang | Fixed | RHSA-2026:102587 | 23.11.2026 |
| Red Hat Enterprise Linux 8 | go-toolset | Fixed | RHSA-2026:102592 | 23.11.2026 |
| Red Hat Enterprise Linux 9 | golang | Fixed | RHSA-2026:102586 | 23.11.2026 |
| Red Hat Hardened Images | golang1-27-main-1.27.4-2.hum1 | Fixed | RHSA-2026:101231 | 21.11.2026 |
Показывать по
Дополнительная информация
Статус:
EPSS
7.8 High
CVSS3
Связанные уязвимости
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
Flag sanitization bypass via "#cgo pkg-config:" directives in cmd/go
Building a malicious package that uses "#cgo pkg-config:" directives c ...
Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility.
EPSS
7.8 High
CVSS3