CVEfocus › CVE database › CVE-2023-39323

CVE-2023-39323Arbitrary code execution during build via line directives in cmd/go

CVSS 8.1 HighEPSS 1.9% (higher than 80% of CVEs)Published 2023-10-05Updated 2025-06-12Assigner: Go

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.

What to do

Fixed builds are available from Alpine, Go, Red Hat, Ubuntu: see the table below for the fixed version per release.

Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

23Fixed
11Fix pending
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04golang-1.21Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.17Fixed1.17.13-3ubuntu1.3UBUNTU-CVE-2023-39323
Ubuntu 22.04golang-1.18Fixed1.18.1-1ubuntu1.2UBUNTU-CVE-2023-39323
Ubuntu 22.04golang-1.20Fixed1.20.3-1ubuntu0.1~22.04.1UBUNTU-CVE-2023-39323
Ubuntu 22.04golang-1.21Fixed1.21.1-1~ubuntu22.04.2UBUNTU-CVE-2023-39323
Ubuntu 20.04golang-1.18Fixed1.18.1-1ubuntu1~20.04.3UBUNTU-CVE-2023-39323
Ubuntu 20.04golang-1.20Fixed1.20.3-1ubuntu0.1~20.04.1UBUNTU-CVE-2023-39323
Ubuntu 20.04golang-1.21Fixed1.21.1-1~ubuntu20.04.2UBUNTU-CVE-2023-39323
Ubuntu 18.04golang-1.18Fix pending1.18.1-1ubuntu1~18.04.4+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-39323
Ubuntu 16.04golang-1.18Fix pending1.18.1-1ubuntu1~16.04.6+esm1 (Ubuntu Pro)UBUNTU-CVE-2023-39323
Debian 12golang-1.19Fix pendingDEBIAN-CVE-2023-39323
Red Hat Enterprise Linux 9go-toolsetFix pending
Affected
Red Hat Enterprise Linux 9golangFix pending
Affected
Red Hat Enterprise Linux 9golang-binFix pending
Affected
Red Hat Enterprise Linux 9golang-docsFix pending
Affected
Red Hat Enterprise Linux 9golang-miscFix pending
Affected
Red Hat Enterprise Linux 9golang-raceFix pending
Affected
Red Hat Enterprise Linux 9golang-srcFix pending
Affected
Red Hat Enterprise Linux 9golang-testsFix pending
Affected
Red Hat Enterprise Linux 8delveFixed0:1.20.2-1.module+el8.9.0+18926+5193682dRHBA-2023:6928
Red Hat Enterprise Linux 8go-toolsetFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golangFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golang-binFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golang-docsFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golang-miscFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golang-srcFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Red Hat Enterprise Linux 8golang-testsFixed0:1.20.10-1.module+el8.9.0+20382+04f7fe80RHBA-2023:6928
Alpine Linux 3.24goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.23goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.22goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.21goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.20goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.19goFixed1.21.2-r0ALPINE-CVE-2023-39323
Alpine Linux 3.18goFixed1.20.9-r0ALPINE-CVE-2023-39323
Go librarytoolchainFixed1.21.2GO-2023-2095

What the vendor says

As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.