CVE-2024-24787: 
Go vulnerability analysis and mitigation

Overview

CVE-2024-24787 is a security vulnerability discovered in the Go programming language that affects Darwin (macOS) systems. The vulnerability was identified in Go versions prior to 1.21.10 and versions from 1.22.0-0 before 1.22.3. The issue occurs when building a Go module containing CGO (Go's foreign function interface for C code) on Darwin systems using Apple's version of the linker (ld), specifically related to the usage of the -lto_library flag in a "#cgo LDFLAGS" directive (Go Announce, Go Packages).

Technical details

The vulnerability stems from the improper handling of the -lto_library flag in the "#cgo LDFLAGS" directive when using Apple's version of the linker. This flag was previously unchecked by Go's "safe linker flags" verification system due to its similarity to the benign -lx flag used for linking libraries. The vulnerability has received a CVSS score of 9.8 (CRITICAL) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NetApp Security).

Impact

Successful exploitation of this vulnerability could lead to arbitrary code execution during the build process when using the go build command. An attacker could potentially load a malicious LTO library, resulting in unauthorized code execution with the privileges of the user running the build process (Security Online).

Exploitability

The vulnerability is exploitable during the build process of Go modules containing CGO on Darwin systems. A proof-of-concept was published on May 10, 2024, increasing the likelihood of exploitation in the wild (Security Online).

Mitigation and workarounds

The vulnerability has been patched in Go versions 1.22.3 and 1.21.10. Users are strongly advised to upgrade to these versions or later. The fix can be obtained by either downloading the binary and source distributions from the Go website or by using git checkout go1.22.3 for those compiling from source (Go Announce).

Community reactions

The vulnerability was responsibly disclosed by Juho Forsén of Mattermost, and the Go team promptly addressed the issue with security patches. The Go team announced the fixes through their official announcement channels, demonstrating their commitment to security (Go Announce).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

golang-1.19

Fixed

bullseye

golang-1.15

Fixed

Source: This report was generated using AI

Related Go vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-56865HIGH8.4
  • Go logoGo
  • eks-kubernetes-fips-1.34
NoYesAug 13, 2026
CVE-2026-56864HIGH7.5
  • Go logoGo
  • redpandadata-console-3.10
NoYesAug 13, 2026
CVE-2026-56862HIGH7.5
  • Go logoGo
  • cert-manager-package-fips-11
NoYesAug 13, 2026
CVE-2026-56859HIGH7.5
  • Go logoGo
  • nri-postgresql-fips
NoYesAug 13, 2026
CVE-2026-56860MEDIUM5.9
  • Go logoGo
  • consul-2
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management