# CVE-2026-97036: Go cgo arbitrary code execution via Apple linker argument injection

Source: https://junglewise.ai/threats/cve-2026-97036-on-darwin-building-a-malicious-package-that-uses-cgo-could-cause  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-11. Updated: 2026-11-11  
License: CC BY 4.0 with a link back

CVE-2026-97036 · Severity: info · Published 2026-11-11

Go's cgo facility on macOS can be exploited through malicious packages that inject crafted linker flags, allowing attackers to execute arbitrary code during the build process. When an attacker controls a Go package used in a project, they can inject arguments that the Apple linker misinterprets to load arbitrary dynamic libraries. This could give attackers complete control over a developer's build environment and compiled binaries.

Technologies: [go (Go)](https://junglewise.ai/threats/technologies/go), [toolchain (Go)](https://junglewise.ai/threats/technologies/toolchain). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-97036 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-97036 being exploited in the wild.

**How severe is CVE-2026-97036?** Informational severity, published 11 November 2026.

**Which products and versions are affected?** go (Go) prior to fix; toolchain (Go) SEMVER:introduced=0,fixed=1.26.11,introduced=1.27.0-0,fixed=1.27.4.

**Is there a fix for CVE-2026-97036?** Yes. toolchain (Go): upgrade to 1.27.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-97036 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-97036?** Check whether you run go (Go) or toolchain (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- toolchain (Go): upgrade to 1.27.4 or later

  ```sh
  go get toolchain@v1.27.4
  ```


## Technical details

A cgo package on Darwin can craft a "#cgo LDFLAGS" directive that separates arguments (e.g., "-l" and "to_library") which the Apple linker recombines into "-lto_library", loading an arbitrary LTO plugin library at link time. The attack requires the malicious package to be present in the build dependency chain. Go now validates and rejects dangerous linker flag patterns in cgo LDFLAGS directives.

## Affected products

- Go Go prior to fix

## Identifiers

- CVE-2026-97036
- GO-2026-6855

## Timeline

- 2026-11-11: disclosed

## References

- [https://pkg.go.dev/](https://pkg.go.dev/)
- [https://go.dev/cl/862149](https://go.dev/cl/862149)

## Related threats

- [Go cgo LDFLAGS validation bypass in cmd/cgo](https://junglewise.ai/threats/cve-2026-97043-building-a-malicious-package-that-uses-cgo-could-bypass-cgo)
- [Go compiler unsafe library path validation in Windows linker](https://junglewise.ai/threats/cve-2026-97042-building-a-malicious-package-that-uses-go-cgo-import-dynamic-or)
- [Go compiler cgo linker flag injection via directives](https://junglewise.ai/threats/cve-2026-97041-building-a-malicious-package-containing-go-cgo-compiler)
- [Go linker arbitrary flag injection via crafted .syso files](https://junglewise.ai/threats/cve-2026-97040-building-a-package-containing-a-crafted-syso-file-could-bypass)
- [Go command unsafe pkg-config flag handling in cgo](https://junglewise.ai/threats/cve-2026-97039-building-a-malicious-package-that-uses-cgo-pkg-config-directives)
