Medium severity · published May 8, 2024
CVE-2024-24787
Arbitrary code execution during build on Darwin in cmd/go
6.4
CVSS
0.8%
EPSS
No
On KEV
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.
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
Attack vector
Local
Complexity
High
Privileges
High
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.8% · higher than 55% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CM
cmd/go · Go toolchain
before 1.21.10; 1.22.0-0 before 1.22.3 · source: vendor
GO
GO · Golang
1.21.0; 1.22 · source: CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-24787
CVE.org
https://www.cve.org/CVERecord?id=CVE-2024-24787
www.openwall.com
http://www.openwall.com/lists/oss-security/2024/05/08/3
go.dev
https://go.dev/cl/583815
go.dev
https://go.dev/issue/67119
groups.google.com
https://groups.google.com/g/golang-announce/c/wkkO4P9stm0
pkg.go.dev
https://pkg.go.dev/vuln/GO-2024-2825
security.netapp.com
https://security.netapp.com/advisory/ntap-20240531-0006/
More from cmd/go
9.8
CVE-2023-24531
Output of "go env" does not sanitize values in cmd/go
8.8
CVE-2026-27140
Code execution vulnerability in SWIG code generation in cmd/go
8.8
CVE-2024-45340
GOAUTH credential leak in cmd/go
8.6
CVE-2025-4674
Unexpected command execution in untrusted VCS repositories in cmd/go
8.4
CVE-2026-56865
Fix transparency log tile verification bypass in golang.org/x/mod/sumdb/tlog
