SEVERITY NOT PROVIDED EPSS 0.7% · 49th percentile

CVE-2026-97036: Arbitrary code execution during build on darwin via "-l to_library" in cgo in cmd/go

Published 2026-11-11 · Updated 2026-11-27 · Also known as BIT-golang-2026-97036, GO-2026-6855

Summary

A flaw in the Go toolchain on Darwin allows arbitrary code execution during the build process via malicious #cgo LDFLAGS. Developers building packages with cgo on macOS should update their Go toolchain to the specified patched versions.

Who is affected

The vulnerability affects Go toolchain users on Darwin systems when processing malicious packages that leverage the Apple linker. By providing specific flags in #cgo LDFLAGS, an attacker can trick the linker into loading an arbitrary LTO plugin, leading to code execution during the compilation phase.

Exploitability

The vulnerability is currently unrated with no official CVSS vector provided. While the EPSS score of 0.007 suggests a relatively low probability of widespread exploitation, it is not listed on the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-27. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Go toolchain >= 0, < 1.26.11 1.26.11 go get [email protected]
Go toolchain >= 1.27.0-0, < 1.27.4 1.27.4 go get [email protected]

FAQ

Does this affect all platforms?

No, the vulnerability specifically impacts the Darwin (macOS) platform because it relies on specific behavior of the Apple linker.

Is there active exploitation?

There is no indication of active exploitation, as the vulnerability is not included in the CISA Known Exploited Vulnerabilities catalog.

What specifically is blocked in the fix?

The fix disallows '-l' followed by 'to_library' and rejects specific linker flags including '-lazy_library', '-lazy_framework', '-load_hidden', '-library', and '-library-path'.

Original advisory description
On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library <path>" in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns.

References

Source records: GO-2026-6855 (OSV.dev) · EPSS by FIRST, 2026-11-27.