Описание
On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library " in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns.
A flaw was found in cmd/go. When a user builds a malicious package using cgo on macOS (Darwin), an attacker can achieve arbitrary code execution on the build system. This issue occurs because the platform linker recombines separated linker flag arguments into a command that loads an arbitrary dynamic library during compilation.
Отчет
This vulnerability is rated as Moderate severity because exploitation requires compiling untrusted source code and depends on linker behaviors unique to Darwin platforms. In Red Hat ecosystems, Go toolsets operate on Linux-based environments utilizing GNU or LLVM linkers that do not evaluate these Darwin-specific linker options. Consequently, typical software compilation workflows on supported Red Hat platforms are not exposed to this execution vector.
Меры по смягчению последствий
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
Связанные уязвимости
On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library <path>" in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns.
On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library <path>" in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns.
Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/go
On Darwin, building a malicious package that uses cgo could cause arbi ...
On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library <path>" in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns.
EPSS
7.8 High
CVSS3