title: Arbitrary code execution via go.mod toolchain directive in cmd/go
description: 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.
problem types: CWE-94: Improper Control of Generation of Code ('Code Injection')
affected:
{
vendor: Go toolchain
product: cmd/go
collectionURL: https://pkg.go.dev
packageName: cmd/go
versions:
version: 1.21.0-0, lessThan: 1.21.1, status: affected, versionType: semver
defaultStatus: unaffected
}