Lucene search

K
osvGoogleOSV:GO-2023-2095
HistoryOct 05, 2023 - 8:35 p.m.

Arbitrary code execution during build via line directives in cmd/go

2023-10-0520:35:05
Google
osv.dev
25
arbitrary code execution
line directives
go build
compiler flags

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

0.002 Low

EPSS

Percentile

53.4%

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.

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

0.002 Low

EPSS

Percentile

53.4%