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

Published May 8, 2024
·
Updated

Arbitrary code execution during build on Darwin in cmd/go

Other sources

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 -ltolibrary flag in a "#cgo LDFLAGS" directive.

NVD

Affected Software

4 affected componentsFixes available
Google Go
Microsoft azl3 golang 1.24.3-1
Microsoft cbl2 msft-golang 1.24.1-2
Microsoft cbl2 msft-golang 1.22.3

Event History

May 8, 2024
CVE Published
via MITRE·03:31 PM
Data Sourced
via MITRE·03:31 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverity
Sep 4, 2025
Data Sourced
via Microsoft·02:45 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·02:45 AM
Affected Software
Updated
via Microsoft·02:45 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2024-24787?

CVE-2024-24787 is classified as a high severity vulnerability due to its potential to allow arbitrary code execution.

2

How do I fix CVE-2024-24787?

To mitigate CVE-2024-24787, it is recommended to update to a patched version of the Go programming language provided by Google.

3

Who is affected by CVE-2024-24787?

CVE-2024-24787 affects users building Go modules that utilize CGO on Darwin systems.

4

What conditions trigger CVE-2024-24787?

CVE-2024-24787 is triggered by the use of the -lto_library flag in a '#cgo LDFLAGS' directive during the build process.

5

Can CVE-2024-24787 be exploited remotely?

CVE-2024-24787 requires local access to exploit, hence it is not considered a remote vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203