CVE-2024-24787
JSON

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 packageVersionsReported by
cmd/gobefore 1.21.10, from 1.22.0-0 before 1.22.3CVE List
golang go1.21.0, 1.22CVE List
toolchain (Go)before 1.21.10, from 1.22.0-0 before 1.22.3Go Vulnerability Database
golang (Bitnami)before 1.21.10, from 1.22.0-0 before 1.22.3Bitnami Vulnerability Database

All scores

CISA-ADP6.4medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasemedium 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

SourceRecordLicence
CVE ListCVE-2024-24787 changed 2025-02-13CVE Terms of Use
Go Vulnerability DatabaseGO-2024-2825 changed 2026-02-04CC-BY-4.0
NVDCVE-2024-24787 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2024-24787 changed 2026-01-28Apache-2.0