SEVERITY NOT PROVIDED EPSS 0.7% · 48th percentile

CVE-2026-97037: Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in cmd/go

Published 2026-11-11 · Updated 2026-11-27 · Also known as BIT-golang-2026-97037, GO-2026-6854

Summary

A linker script injection vulnerability exists in the cgo toolchain of cmd/go through improper handling of split -Wl, and Darwin or symbol linker flags. Engineering and security teams managing Go toolchain deployments should update their environments.

Who is affected

Building a malicious package utilizing cgo can lead to arbitrary code execution at link time by passing linker script files to the host linker via #cgo LDFLAGS. This affects deployments utilizing vulnerable Go toolchain versions when compiling untrusted packages.

Exploitability

The severity and CVSS vector are not documented, and the vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities catalog. The EPSS score is 0.007 with a percentile of 0.479.

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

What causes the linker script injection in cmd/go?

It is caused by split -Wl, flags accepting bare second arguments without a -Wl, prefix and certain flags causing linkers to interpret arguments as linker scripts.

Which software packages are affected?

The Go toolchain is affected, specifically versions introduced before 1.26.11 and versions from 1.27.0-0 before 1.27.4.

How has the issue been fixed in the Go toolchain?

The go command now requires a -Wl, prefix on the second token of split -Wl, flags (except -Wl,-R), verifies they do not reference linker script files, and disallows bare -Wl,--warn-backrefs-exclude.

Original advisory description
Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude".

References

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