# CVE-2024-24787: Arbitrary code execution during build on Darwin in cmd/go

- Severity: Medium 6.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.51%, higher than 37% of CVEs (2026-11-30)
- Published: 2024-05-08T15:17:04.000Z
- Modified: 2026-06-17T07:14:51.640Z
- Also known as: GO-2024-2825, BIT-GOLANG-2024-24787
- Related: CGA-5gf2-fvqf-g4jv
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Go

## Description

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.

(As written by CVE List.)

## Affected

- cmd/go: before 1.21.10; from 1.22.0-0 before 1.22.3
- golang go: 1.21.0; 1.22
- toolchain (Go): before 1.21.10; from 1.22.0-0 before 1.22.3
- golang (Bitnami): before 1.21.10; from 1.22.0-0 before 1.22.3

## Every score

- CISA-ADP: CVSS:3.1 6.4 Medium `CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://go.dev/issue/67119> (report, web)
- <https://go.dev/cl/583815> (fix, web)
- <https://groups.google.com/g/golang-announce/c/wkkO4P9stm0> (web)
- <https://pkg.go.dev/vuln/GO-2024-2825> (web)
- <https://security.netapp.com/advisory/ntap-20240531-0006/> (web)
- <http://www.openwall.com/lists/oss-security/2024/05/08/3> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-24787> (web)

## Sources

- CVE List: [CVE-2024-24787](https://www.cve.org/CVERecord?id=CVE-2024-24787), CVE Terms of Use, modified 2025-02-13
- Go Vulnerability Database: [GO-2024-2825](https://pkg.go.dev/vuln/GO-2024-2825), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-24787](https://nvd.nist.gov/vuln/detail/CVE-2024-24787), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2024-24787](https://osv.dev/vulnerability/BIT-GOLANG-2024-24787), Apache-2.0, modified 2026-01-28

---

Page: https://cve.day/CVE-2024-24787 · Whole record: https://cve.day/CVE-2024-24787.json · Rebuilt by cve.day 2026-11-25T22:58:40.094Z
