---
id: "CVE-2026-97037"
page: "https://infrastack.ai/live/CVE-2026-97037"
kind: "vulnerability"
aliases: ["CVE-2026-97037", "GO-2026-6854"]
title: "Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in cmd/go"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "runtime"
products: [{"name": "toolchain", "fixed": ["1.26.11", "1.27.4"], "affected": ">= 1.27.0-0, < 1.27.4", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["cgo", "ci-builds", "go", "runtime"]
not_affected_if: ["cgo-disabled", "pure-go-code", "trusted-packages-only"]
published_at: "2026-11-11T02:51:11+00:00"
first_seen_at: "2026-11-11T03:37:17+00:00"
updated_at: "2026-11-11T03:38:59+00:00"
sources: [{"source": "govuln", "url": "https://pkg.go.dev/vuln/GO-2026-6854", "first_seen_at": "2026-11-11T03:37:17+00:00"}]
exploit_sources: []
---

# Linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo in cmd/go

Link for people: https://infrastack.ai/live/CVE-2026-97037 (this .md is for agents)

Go's cgo support passed certain split -Wl, linker flags to the host linker in a way that let a malicious package supply a linker script. Building that package can run arbitrary code on the build machine.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:toolchain affected >= 1.27.0-0, < 1.27.4 fixed 1.26.11, 1.27.4

## How to check

- Run `go version` on build machines and CI runners to see the installed toolchain.
- Check whether builds compile cgo code (`CGO_ENABLED=1`) from packages you do not fully trust.

## Fix

- Go 1.27 line: upgrade to `1.27.4`.
- Go 1.26 line: upgrade to `1.26.11`.

## Timeline

- 2026-11-11T03:37:17+00:00 govuln https://pkg.go.dev/vuln/GO-2026-6854

## From the sources

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".

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
