CVE-2024-24787
6.4medium
Arbitrary code execution during build on Darwin in cmd/go
- Severity
- 6.4medium CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.51% (higher than 37% of CVEs)
- Published
- Last changed
- Assigned by
- Go
- Also known as
- GO-2024-2825BIT-GOLANG-2024-24787
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| cmd/go | before 1.21.10, from 1.22.0-0 before 1.22.3 | CVE List |
| golang go | 1.21.0, 1.22 | CVE List |
| toolchain (Go) | before 1.21.10, from 1.22.0-0 before 1.22.3 | Go Vulnerability Database |
| golang (Bitnami) | before 1.21.10, from 1.22.0-0 before 1.22.3 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 6.4medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H |
| Bitnami Vulnerability Database | medium rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
En Darwin, crear un módulo Go que contenga CGO puede desencadenar la ejecución de código arbitrario cuando se usa la versión Apple de ld, debido al uso del indicador -lto_library en una directiva "#cgo LDFLAGS".
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-24787 changed 2025-02-13 | CVE Terms of Use |
| Go Vulnerability Database | GO-2024-2825 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2024-24787 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2024-24787 changed 2026-01-28 | Apache-2.0 |