Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

redhat логотип

CVE-2026-97037

Опубликовано: 11 нояб. 2026
Источник: redhat
CVSS3: 7.8
EPSS Низкий

Описание

Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

A flaw was found in cmd/go. An attacker can achieve arbitrary code execution on a system that compiles a malicious package utilizing cgo (Go's C programming language integration feature). When building the untrusted package, improperly validated linker flags allow malicious linker script files to be forwarded to the host linker, enabling untrusted command execution during the build process.

Отчет

This vulnerability is rated as Moderate impact for Red Hat products because exploitation requires explicit user interaction to fetch and compile untrusted source code. The issue resides within the Go build toolchain and is only triggered during the link phase of compilation when processing packages with C language bindings. Deployed binaries and runtime environments running pre-compiled Go software are unaffected. In typical deployments, risk is confined to development workstations and continuous integration pipelines handling untrusted third-party repositories.

Меры по смягчению последствий

Disable cgo support by setting the environment variable CGO_ENABLED=0 before compiling Go code, or isolate build environments processing untrusted dependencies within a sandboxed container. To disable cgo in the environment:

export CGO_ENABLED=0

Caveats: Setting CGO_ENABLED=0 will cause build failures for any Go applications or modules that strictly depend on C language bindings or native C libraries. In environments where cgo is strictly required, avoid compiling untrusted Go source packages or isolate the build process inside a restricted, unprivileged container with no access to sensitive host directories or network resources.

Затронутые пакеты

ПлатформаПакетСостояниеРекомендацияРелиз
Exploit Intelligenceexploit-intelligence/vulnerability-analysis-rhel9Affected
Migration Toolkit for Applications 8mta/mta-go-external-provider-rhel9Affected
Red Hat Hardened Imagesgolang1.25Will not fix
Red Hat OpenShift Container Platform 4openshift4/ose-operator-sdk-rhel8Affected
Red Hat OpenShift Container Platform 4openshift4/ose-operator-sdk-rhel9Affected
Red Hat OpenShift Dev Spacesdevspaces/udi-rhel9Affected
Red Hat Enterprise Linux 10golangFixedRHSA-2026:10258723.11.2026
Red Hat Enterprise Linux 8go-toolsetFixedRHSA-2026:10259223.11.2026
Red Hat Enterprise Linux 9golangFixedRHSA-2026:10258623.11.2026
Red Hat Hardened Imagesgolang1-27-main-1.27.4-2.hum1FixedRHSA-2026:10123121.11.2026

Показывать по

Дополнительная информация

Статус:

Moderate
Дефект:
CWE-88
https://bugzilla.redhat.com/show_bug.cgi?id=2571449cmd/go: golang: cmd/go: arbitrary code execution via malicious cgo linker flags

EPSS

Процентиль: 48%
0.00686
Низкий

7.8 High

CVSS3

Связанные уязвимости

CVSS3: 8.8
ubuntu
16 дней назад

Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

CVSS3: 8.8
nvd
16 дней назад

Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

CVSS3: 8.1
msrc
15 дней назад

Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in cmd/go

CVSS3: 8.8
debian
16 дней назад

Building a malicious package that uses cgo could cause arbitrary code ...

CVSS3: 8.8
github
16 дней назад

Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

EPSS

Процентиль: 48%
0.00686
Низкий

7.8 High

CVSS3