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

exploitDog

redhat логотип

CVE-2026-97035

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

Описание

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-" or "-gnat" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path

" flag and GCC's two-argument "-gnatO " flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-" and "-gnat" flags are now disallowed in "#cgo" compiler and linker flags.

A flaw was found in cmd/go. An attacker could achieve arbitrary code execution or write files to arbitrary locations by enticing a developer or automated build system to compile a crafted package. This vulnerability occurs when compiling packages that use cgo (Go's C-language interoperability feature), where overly broad compiler flag allowlists permit unexpected multi-argument options that desynchronize command argument parsing and inject unvalidated linker inputs.

Отчет

This vulnerability is rated as Moderate severity because exploitation requires an attacker to entice a developer or automated build pipeline into compiling untrusted source code. Runtime environments executing already built binaries are unaffected, as the risk is isolated strictly to the compilation stage. On typical Red Hat Enterprise Linux systems, the Go toolset is utilized as a developer utility rather than an exposed network daemon, limiting the blast radius to development workstations or continuous integration runners processing external code.

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

Disable cgo during compilation by setting the CGO_ENABLED environment variable:

export CGO_ENABLED=0

Caveats: Go packages and applications that require native C bindings will fail to compile while cgo is disabled. If cgo is strictly required, isolate build workflows within unprivileged, ephemeral containers or sandboxes and avoid compiling unverified third-party code.

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

ПлатформаПакетСостояниеРекомендацияРелиз
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=2571444cmd/go: golang: cmd/go: arbitrary code execution via crafted cgo directives

EPSS

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

7.8 High

CVSS3

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

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

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-*" or "-gnat*" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path <dir>" flag and GCC's two-argument "-gnatO <file>" flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-*" and "-gnat*" flags are now disallowed in "#cgo" compiler and linker flags.

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

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-*" or "-gnat*" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path <dir>" flag and GCC's two-argument "-gnatO <file>" flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-*" and "-gnat*" flags are now disallowed in "#cgo" compiler and linker flags.

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

Unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo in cmd/go

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

When using Clang or GCC, building a malicious package that uses cgo co ...

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

When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-*" or "-gnat*" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path <dir>" flag and GCC's two-argument "-gnatO <file>" flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-*" and "-gnat*" flags are now disallowed in "#cgo" compiler and linker flags.

EPSS

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

7.8 High

CVSS3