Skip to content
Fencer Vulns
critical 9.8

CVE-2023-39320 json

Arbitrary code execution via go.mod toolchain directive in cmd/go

published 2023-09-07 3 y ago modified 2026-09-08 2 mo ago also BIT-golang-2023-39320 , EUVD-2023-43052 , GO-2023-2042

cvss
9.8
version 3.1, NVD
cisa kev
Not listed
not in CISA's catalog
epss
1.8%
EPSS 1.8% chance of exploitation in 30 days, percentile 78%
public exploits
0
none known

Summary

The go.mod toolchain directive, introduced in Go 1.21, can be leveraged to execute scripts and binaries relative to the root of the module when the "go" command was executed within the module. This applies to modules downloaded using the "go" command from the module proxy, as well as modules downloaded directly using VCS software.

Patch / fix

  • bitnami golang 1.21.1
  • go toolchain 1.21.1
  • Go toolchain cmd/go 1.21.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.21 SLE Module for Development Tools 15 SP5, SLE Module for Development Tools 15 SP4, openSUSE Leap 15.5 +1 more 1.21.1-150000.1.6.1

suse advisories SUSE-SU-2023:4469-1SUSE-SU-2023:3701-1

  • go1.21 openSUSE Tumbleweed 1.21.1-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:13217-1openSUSE-SU-2023:0360-1

  • go Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 1.21.1-r0

alpine advisories ALPINE-CVE-2023-39320

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

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-39320 updated cvss 8.8

golang: cmd/go: go.mod toolchain directive allows arbitrary execution

  • Red Hat OpenShift Service Mesh 2 openshift-golang-builder-container Red Hat Enterprise Linux 8 delve, golang, go-toolset, golang-bin, golang-src, golang-misc, +2 more Red Hat Enterprise Linux 9 golang, go-toolset, golang-bin, golang-src, golang-misc, golang-race, +1 more Red Hat OpenShift Container Platform 4 openshift-golang-builder-container Red Hat OpenShift Virtualization 4 openshift-golang-builder-container Red Hat Storage 3 golang, golang-bin, golang-src, golang-misc, golang-tests, go-toolset-7-golang
    not 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
yes
Technical impact
total
Assessed
2 y ago

Exploit prediction

1.76% chance of exploitation in the next 30 days, higher than 78% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
NVD 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
bitnami golang
>=1.21.0, <1.21.1
1.21.1
go toolchain
>=1.21.0-0, <1.21.1
1.21.1

Affected products

  • Go toolchain cmd/go

Classification

Weakness
  • CWE-94 Improper Control of Generation of Code

References

Sources

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.