Skip to content
CVE PROGRAM SOURCE RECORD8.1 High

CVE-2023-39323

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

Description

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.

Affected products

Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.

Go toolchain cmd/go

Default version status: unaffected

  • 0 to < 1.20.9affected
  • 1.21.0-0 to < 1.21.2affected

References