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

exploitDog

redhat логотип

CVE-2023-39323

Опубликовано: 05 окт. 2023
Источник: redhat
CVSS3: 8.1

Описание

Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.

A flaw was found in the golang cmd/go standard library. A line directive ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to pass during compilation. This can result in the unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.

Отчет

This attack requires knowledge of the absolute path to the file containing the malicious directive, which significantly limits its feasibility for external attackers unless they already have local access or detailed knowledge of the system's layout. To exploit the vulnerability, an attacker must also convince a developer to download and build a malicious Go module—an action typically constrained by trusted workflows and package verification. Importantly, this vulnerability does not impact running applications. Instead, it targets the development process, specifically developers or CI/CD pipelines during the build phase, further narrowing its scope. As a result, this issue has been rated Moderate due to the multiple complex and unlikely prerequisites required for a successful exploit. Within regulated environments, a combination of the following controls acts as a significant barrier to successfully exploiting a CWE-94: Improper Control of Generation of Code ('Code Injection') vulnerability and therefore downgrades the severity of this particular CVE from Moderate to Low. The platform leverages a web application firewall (WAF) to filter and block malicious input before it reaches the application. It applies managed and custom rule sets to detect suspicious patterns such as embedded scripting functions and remote code execution attempts. By enforcing strict input validation and preventing unauthorized execution of user-supplied code, the WAF reduces the risk of exploitation. Additional protections like rate limiting and bot mitigation help prevent automated injection attacks, while integration with logging, monitoring, and threat detection systems enhances visibility and response capabilities. Through real-time monitoring and automated blocking, the WAF provides a strong layer of defense against code injection vulnerabilities, lowering the likelihood of successful exploitation.

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

ПлатформаПакетСостояниеРекомендацияРелиз
OpenShift Service Mesh 2openshift-golang-builder-containerNot affected
Red Hat Enterprise Linux 9golangAffected
Red Hat OpenShift Container Platform 4openshift-golang-builder-containerNot affected
Red Hat OpenShift Virtualization 4openshift-golang-builder-containerAffected
Red Hat Storage 3golangAffected
Red Hat Storage 3go-toolset-7-golangAffected
Red Hat Enterprise Linux 8go-toolsetFixedRHBA-2023:692814.11.2023
Red Hat Enterprise Linux 8rhel8/go-toolsetFixedRHEA-2023:731116.11.2023
Red Hat Enterprise Linux 8ubi8/go-toolsetFixedRHEA-2023:731116.11.2023

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

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

Статус:

Moderate
Дефект:
CWE-94
https://bugzilla.redhat.com/show_bug.cgi?id=2242544golang: cmd/go: line directives allows arbitrary execution during build

8.1 High

CVSS3

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

CVSS3: 8.1
ubuntu
больше 1 года назад

Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.

CVSS3: 8.1
nvd
больше 1 года назад

Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.

CVSS3: 8.1
debian
больше 1 года назад

Line directives ("//line") can be used to bypass the restrictions on " ...

suse-cvrf
больше 1 года назад

Security update for go1.20

suse-cvrf
больше 1 года назад

Security update for go1.21

8.1 High

CVSS3