CVEfocus › CVE database › CVE-2023-39320

CVE-2023-39320Arbitrary code execution via go.mod toolchain directive in cmd/go

CVSS 9.8 CriticalEPSS 1.8% (higher than 79% of CVEs)Published 2023-09-08Updated 2025-02-13Assigner: Go

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.

What to do

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

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

7Fixed
36Not 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.17Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.18Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.20Not affected
vulnerable_code_not_present
Ubuntu 22.04golang-1.21Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.13Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.14Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.18Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.20Not affected
vulnerable_code_not_present
Ubuntu 20.04golang-1.21Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.10Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.8Not affected
vulnerable_code_not_present
Ubuntu 18.04golang-1.9Not affected
vulnerable_code_not_present
Ubuntu 16.04golang-1.10Not affected
vulnerable_code_not_present
Ubuntu 16.04golang-1.13Not affected
vulnerable_code_not_present
Ubuntu 16.04golang-1.6Not affected
vulnerable_code_not_present
Ubuntu 14.04golangNot affected
vulnerable_code_not_present
Ubuntu 14.04golang-1.10Not affected
vulnerable_code_not_present
Ubuntu 14.04golang-1.6Not affected
vulnerable_code_not_present
Red Hat Enterprise Linux 9go-toolsetNot affected
Red Hat Enterprise Linux 9golangNot affected
Red Hat Enterprise Linux 9golang-binNot affected
Red Hat Enterprise Linux 9golang-docsNot affected
Red Hat Enterprise Linux 9golang-miscNot affected
Red Hat Enterprise Linux 9golang-raceNot affected
Red Hat Enterprise Linux 9golang-srcNot affected
Red Hat Enterprise Linux 9golang-testsNot affected
Red Hat Enterprise Linux 8delveNot affected
Red Hat Enterprise Linux 8go-toolsetNot affected
Red Hat Enterprise Linux 8golangNot affected
Red Hat Enterprise Linux 8golang-binNot affected
Red Hat Enterprise Linux 8golang-docsNot affected
Red Hat Enterprise Linux 8golang-miscNot affected
Red Hat Enterprise Linux 8golang-raceNot affected
Red Hat Enterprise Linux 8golang-srcNot affected
Red Hat Enterprise Linux 8golang-testsNot affected
Alpine Linux 3.24goFixed1.21.1-r0ALPINE-CVE-2023-39320
Alpine Linux 3.23goFixed1.21.1-r0ALPINE-CVE-2023-39320
Alpine Linux 3.22goFixed1.21.1-r0ALPINE-CVE-2023-39320
Alpine Linux 3.21goFixed1.21.1-r0ALPINE-CVE-2023-39320
Alpine Linux 3.20goFixed1.21.1-r0ALPINE-CVE-2023-39320
Alpine Linux 3.19goFixed1.21.1-r0ALPINE-CVE-2023-39320
Go librarytoolchainFixed1.21.1GO-2023-2042

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.