Advisory

GO-2023-2042

Also known as: BIT-golang-2023-39320, CVE-2023-39320

Summary

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

Details

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.

Severity

Not rated by the source.

Dates

Published
2023-09-07 16:11 UTC
Modified
2026-02-04 02:32 UTC

Affected packages and fixes

toolchain

Go · All systems

Affected

  • introduced 1.21.0-0, fixed 1.21.1 (semver)

Fixed versions

1.21.1

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Go Vulnerability Database · CC BY 4.0

Sources & licences