{"id":"CVE-2024-24787","published":"2024-05-08T15:31:14Z","modified":"2025-02-13T17:40:26Z","title":"Arbitrary code execution during build on Darwin in cmd/go","vendor":"Go toolchain","product":"cmd/go","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.0076,"percentile":0.56192,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/67119","tags":[]},{"url":"https://go.dev/cl/583815","tags":[]},{"url":"https://groups.google.com/g/golang-announce/c/wkkO4P9stm0","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2024-2825","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20240531-0006/","tags":[]},{"url":"http://www.openwall.com/lists/oss-security/2024/05/08/3","tags":[]}],"priority":{"score":20.7,"factors":[{"name":"EPSS percentile","points":11.24},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":4.48}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2024-05-10","earliestUrl":"https://github.com/LOURC0D3/CVE-2024-24787-PoC","repos":[{"name":"LOURC0D3/CVE-2024-24787-PoC","url":"https://github.com/LOURC0D3/CVE-2024-24787-PoC","stars":5,"created":"2024-05-10"}]},"first":{"date":"2024-05-10","source":"PoC-in-GitHub","url":"https://github.com/LOURC0D3/CVE-2024-24787-PoC"},"provenance":"source"},"vendorSlug":"go-toolchain","affectedVersions":[{"vendor":"Go toolchain","product":"cmd/go","versions":["< 1.21.10",">= 1.22.0-0, < 1.22.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-06-05T14:49:29.014816Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"toolchain","vulnerableRanges":["<1.21.10",">=1.22.0-0, <1.22.3"],"patched":["1.21.10","1.22.3"],"from":["GO-2024-2825"],"provenance":"source"}],"summary":{"text":"The flaw lies in the cmd/go component of the Go toolchain on Darwin: building a Go module that contains CGO can trigger arbitrary code execution when the Apple version of ld is used, because a \"#cgo LDFLAGS\" directive passes the -lto_library flag. Exploitation requires a local attacker who can get a malicious #cgo LDFLAGS directive into a module being built, which must then be built on a Darwin system with CGO enabled, and it involves high attack complexity and privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:29:20Z"},"euvd":{"id":"EUVD-2024-22164","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-39320","published":"2023-09-08","fixed":"1.21.1","kev":false},{"cve":"CVE-2023-39323","published":"2023-10-05","fixed":"1.21.2","kev":false},{"cve":"CVE-2023-45285","published":"2023-12-06","fixed":"1.21.5","kev":false,"link":{"from":"CVE-2023-45285","to":"CVE-2024-24787","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.21.5","toFixed":"1.21.10","daysApart":154}]}},{"cve":"CVE-2024-24787","published":"2024-05-08","fixed":"1.22.3","kev":false},{"cve":"CVE-2024-45340","published":"2025-01-28","fixed":"1.24.0-rc.2","kev":false},{"cve":"CVE-2025-22867","published":"2025-02-06","fixed":"1.24.0-rc.3","kev":false},{"cve":"CVE-2025-4674","published":"2025-07-29","fixed":"1.24.5","kev":false,"link":{"from":"CVE-2024-24787","to":"CVE-2025-4674","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.22.3","toFixed":"1.23.11","daysApart":447}]}}],"package":"Go:toolchain"}}