Advisory

GO-2023-1839

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

Summary

Code injection via go command with cgo in cmd/go

Details

The go command may generate unexpected code at build time when using cgo. This may result in unexpected behavior when running a go program which uses cgo.

This may occur when running an untrusted module which contains directories with newline characters in their names. Modules which are retrieved using the go command, i.e. via "go get", are not affected (modules retrieved using GOPATH-mode, i.e. GO111MODULE=off, may be affected).

Severity

Not rated by the source.

Dates

Published
2023-06-08 20:16 UTC
Modified
2026-02-04 04:29 UTC

Affected packages and fixes

toolchain

Go · All systems

Affected

  • introduced 0, fixed 1.19.10, introduced 1.20.0-0, fixed 1.20.5 (semver)

Fixed versions

1.19.10, 1.20.5

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