{"schema_version":"1.7.3","id":"GO-2024-2825","published":"2024-05-08T15:17:04Z","modified":"2026-02-04T02:31:37.758576Z","aliases":["BIT-golang-2024-24787","CVE-2024-24787"],"related":["CGA-5gf2-fvqf-g4jv"],"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.","affected":[{"package":{"name":"toolchain","ecosystem":"Go","purl":"pkg:golang/toolchain"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.21.10"},{"introduced":"1.22.0-0"},{"fixed":"1.22.3"}]}],"ecosystem_specific":{"imports":[{"goos":["darwin"],"path":"cmd/go"}]},"database_specific":{"source":"https://vuln.go.dev/ID/GO-2024-2825.json"}}],"references":[{"type":"REPORT","url":"https://go.dev/issue/67119"},{"type":"FIX","url":"https://go.dev/cl/583815"},{"type":"WEB","url":"https://groups.google.com/g/golang-announce/c/wkkO4P9stm0"}],"database_specific":{"review_status":"REVIEWED","url":"https://pkg.go.dev/vuln/GO-2024-2825"},"credits":[{"name":"Juho Forsén (Mattermost)"}]}