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

exploitDog

redhat логотип

CVE-2026-97043

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

Описание

Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo*" pragma strings with strconv.Unquote, and the slice bounds check in processCgoOutputs has been fixed.

A flaw was found in Go. An attacker can achieve arbitrary code execution or cause a Denial of Service (DoS) by enticing a user to build a specially crafted package using cgo. This issue occurs because the Go build tools improperly handle quotation marks and escape sequences in cgo directives, allowing unauthorized linker flags to bypass security validation and be passed to the external linker.

Отчет

This flaw is rated Moderate rather than Important because successful exploitation requires compiling untrusted source code, restricting risk exposure to build and development environments rather than impacting deployed production runtime services. Red Hat Enterprise Linux and container base images distribute the Go toolchain for software development, leaving systems running precompiled Go binaries unaffected. An attacker must convince a developer or automated continuous integration pipeline to build an untrusted cgo-enabled module, allowing manipulated linker options to bypass validation and execute commands under the privileges of the build process.

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

Disable cgo by setting the CGO_ENABLED environment variable before executing build commands: export CGO_ENABLED=0 Caveats: This setting prevents the compilation of any Go packages that require cgo or link against native C libraries. Alternatively, build untrusted Go source code exclusively within isolated containers or sandboxed environments to prevent compromise of the host system.

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

ПлатформаПакетСостояниеРекомендацияРелиз
Exploit Intelligenceexploit-intelligence/vulnerability-analysis-rhel9Affected
Migration Toolkit for Applications 8mta/mta-go-external-provider-rhel9Not affected
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-0.1.hum1FixedRHSA-2026:9900311.11.2026

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

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

Статус:

Moderate
Дефект:
CWE-88
https://bugzilla.redhat.com/show_bug.cgi?id=2571443cmd/go: cmd/compile: golang: golang: arbitrary code execution via crafted cgo compiler directives

EPSS

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

7.8 High

CVSS3

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

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

Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "_cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo_*" pragma strings with strconv.Unquote, and the slice bounds chec...

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

Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "_cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo_*" pragma strings with strconv.Unquote, and the slice bounds check i

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

Unexpected code execution via escaped quotes in //go:cgo_ldflag in cmd/go and cmd/compile

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

Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" ...

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

Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "_cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo_*" pragma strings with strconv.Unquote, and the slice bounds chec...

EPSS

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

7.8 High

CVSS3