CVE-2023-39323 json
Arbitrary code execution during build via line directives in cmd/go
published 2023-10-05 3 y ago modified 2026-09-08 2 mo ago also BIT-golang-2023-39323 , EUVD-2023-43055 , GO-2023-2095
- cvss
- 8.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.9%
- EPSS 1.9% chance of exploitation in 30 days, percentile 79%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- bitnami golang 1.20.9, 1.21.2
- go toolchain 1.20.9, 1.21.2
- Go toolchain cmd/go 1.20.9, 1.21.2
- golang-1.17 Ubuntu 22.04 LTS 1.17.13-3ubuntu1.3
- golang-1.18 Ubuntu 20.04 LTS 1.18.1-1ubuntu1~20.04.3
- golang-1.18 Ubuntu 22.04 LTS 1.18.1-1ubuntu1.2
- golang-1.20 Ubuntu 20.04 LTS 1.20.3-1ubuntu0.1~20.04.1
- golang-1.20 Ubuntu 22.04 LTS 1.20.3-1ubuntu0.1~22.04.1
- golang-1.21 Ubuntu 20.04 LTS 1.21.1-1~ubuntu20.04.2
- golang-1.21 Ubuntu 22.04 LTS 1.21.1-1~ubuntu22.04.2
- golang-1.18 Ubuntu Pro 16.04 LTS 1.18.1-1ubuntu1~16.04.6+esm1
ubuntu advisories UBUNTU-CVE-2023-39323
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- delve RHEL 8 1.20.2-1.module+el8.9.0+18926+5193682d
- golang RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
- go-toolset RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
- golang-bin RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
- golang-src RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
- golang-misc RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
- golang-tests RHEL 8 1.20.10-1.module+el8.9.0+20382+04f7fe80
red hat advisories RHBA-2023:6928
- go1.20-openssl SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.20.11.1-150000.1.14.1
- go1.21-openssl SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.21.4.1-150000.1.5.1
- go1.20 SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.20.9-150000.1.26.1
- go1.21 SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.21.2-150000.1.9.1
suse advisories SUSE-SU-2023:4472-1SUSE-SU-2023:4469-1SUSE-SU-2023:4018-1SUSE-SU-2023:4017-1
- go1.20 openSUSE Tumbleweed 1.20.9-1.1
- go1.21 openSUSE Tumbleweed 1.21.2-1.1
- go1.21 Package Hub 12 1.21.3-2.1
- go Package Hub 12 1.21-41.1
opensuse advisories openSUSE-SU-2024:13306-1openSUSE-SU-2024:13307-1openSUSE-SU-2023:0360-1
- go Alpine 3.18 1.20.9-r0
- go Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 1.21.2-r0
alpine advisories ALPINE-CVE-2023-39323
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- golang CBL-Mariner 2.0, Azure Linux 3.0 1.20.10-1
- golang CBL-Mariner 2.0 1.21.6-1
azure linux advisories AZL-31107AZL-37358AZL-37389AZL-52845
Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT
- go.dev/issue/63211 patch
- go.dev/cl/533215 patch
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-39323 updated cvss 8.1
golang: cmd/go: line directives allows arbitrary execution during build
-
Red Hat Enterprise Linux 9 golang, go-toolset, golang-bin, golang-src, golang-misc, golang-race, +1 more Red Hat OpenShift Virtualization 4 openshift-golang-builder-containeraffected: no fix available
-
Red Hat Storage 3 golang, golang-bin, golang-src, golang-misc, golang-tests, go-toolset-7-golangaffected: no fix planned “Will not fix”
-
Red Hat Enterprise Linux AppStream (v. 8) ubi8/go-toolset 1.20.10-3, rhel8/go-toolset 1.20.10-3, delve 1.20.2-1.module+el8.9.0+18926+5193682d, golang 1.20.10-1.module+el8.9.0+20382+04f7fe80, go-toolset 1.20.10-1.module+el8.9.0+20382+04f7fe80, golang-bin 1.20.10-1.module+el8.9.0+20382+04f7fe80, +3 morefixed: vendor fix RHBA-2023:6928
-
Red Hat OpenShift Service Mesh 2 openshift-golang-builder-container Red Hat OpenShift Container Platform 4 openshift-golang-builder-containernot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 16 mo ago
Exploit prediction
1.91% chance of exploitation in the next 30 days, higher than 79% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| bitnami | golang | <1.20.9 >=1.21.0, <1.21.2 |
1.20.9 1.21.2 |
| go | toolchain | <1.20.9 >=1.21.0-0, <1.21.2 |
1.20.9 1.21.2 |
Affected products
- Go toolchain cmd/go
References
-
go.dev
/issue/63211
issue-tracking, patch, report
-
go.dev
/cl/533215
patch
-
pkg.go.dev
/vuln/GO-2023-2095
vendor-advisory, advisory
-
groups.google.com
/g/golang-announce/c/XBa1oHDevAo
mailing-list, release-notes, discussion, web
-
security.netapp.com
/advisory/ntap-20231020-0001/
third-party-advisory, advisory
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
mailing-list, third-party-advisory, advisory
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
mailing-list, third-party-advisory, advisory
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
mailing-list, third-party-advisory, advisory
-
security.gentoo.org
/glsa/202311-09
third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2023-39323
web
Sources
- CVE List CVE-2023-39323
- NVD CVE-2023-39323
- OSV BIT-golang-2023-39323
- OSV GO-2023-2095
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.