Описание
Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
A flaw was found in the Go toolchain. An attacker could achieve arbitrary code execution by convincing a user or automated system to build a malicious package containing crafted dynamic import directives or Portable Executable (PE) object files on Windows. Due to insufficient validation of imported dynamic-link library (DLL) names, unsafe arguments containing directory traversal sequences are passed to the external linker, allowing the build process to reference or load arbitrary files on disk.
Отчет
This vulnerability is rated as Moderate impact because exploitation requires a user to build an untrusted Go package or link against a specially crafted PE object targeted for Windows environments. Red Hat Enterprise Linux and container runtimes execute on Linux architectures, where Windows-specific PE linker routines are not invoked during standard native builds. Consequently, Red Hat products and workflows face minimal operational risk unless cross-compiling or processing untrusted third-party Windows binaries.
Меры по смягчению последствий
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 |
Показывать по
Дополнительная информация
Статус:
7.8 High
CVSS3
Связанные уязвимости
Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l<name>" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l<name>" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link
Building a malicious package that uses "//go:cgo_import_dynamic" or li ...
Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l<name>" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@".
7.8 High
CVSS3