Advisory

GO-2024-2825

Also known as: BIT-golang-2024-24787, CVE-2024-24787

Summary

Arbitrary code execution during build on Darwin in cmd/go

Details

On Darwin, building a Go module which contains CGO can trigger arbitrary code execution when using the Apple version of ld, due to usage of the -lto_library flag in a "#cgo LDFLAGS" directive.

Severity

Not rated by the source.

Dates

Published
2024-05-08 15:17 UTC
Modified
2026-02-04 02:31 UTC

Affected packages and fixes

toolchain

Go · All systems

Affected

  • introduced 0, fixed 1.21.10, introduced 1.22.0-0, fixed 1.22.3 (semver)

Fixed versions

1.21.10, 1.22.3

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