Read the docs

Host linker flag injection via cgo directives in Go cmd/compile and cmd/link

Priority MEDIUM 40CWE-88Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA. Impact type from CWE-88.

Summary

The Go toolchain's cmd/compile and cmd/link, in versions before 1.26.11 and from 1.27.0-0 before 1.27.4, do not reject commas in cgo directives such as //go:cgo_import_dynamic, so a crafted symbol name or dynamic linker path can inject arbitrary flags into the external linker on ELF platforms (CWE-88). An attacker who can supply a malicious package can affect the build host when a user builds it.

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

Description from the CNA

Building a malicious package containing "//go:cgo_*" compiler directives could inject arbitrary flags into the external linker invocation on ELF platforms. The compiler and linker did not reject commas in "//go:cgo_import_dynamic", "//go:cgo_export_dynamic", "//go:cgo_export_static", "//go:cgo_import_static", and "//go:cgo_dynamic_linker" directives, and the linker passed the dynamic linker path using "-Wl,--dynamic-linker,<path>". Furthermore, the two-argument form of "//go:cgo_import_dynamic" (which is permitted in non-cgo Go source files) could overwrite the external symbol name of a symbol already marked for cgo export. A symbol name or dynamic linker path containing a comma or leading "@" could split "-Wl,--export-dynamic-symbol=" or "-Wl,--dynamic-linker," into arbitrary host linker flags or response file arguments. The compiler and linker now reject commas in "//go:cgo_*" symbol and dynamic linker directives, the linker passes "-Wl,--dynamic-linker=<path>", and "cgo_import_dynamic" no longer overwrites symbols exported via "cgo_export_dynamic" or "cgo_export_static".

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00234 14th percentileScored 2026-11-16
Fix Fixed cmd/compile (Go toolchain): 1.26.11, 1.27.4cmd/link (Go toolchain): 1.26.11, 1.27.4

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
Go standard librarycmd/compilebefore 1.26.11; 1.27.0-0 to before 1.27.41.26.11, 1.27.4Patch availableCNA
Go standard librarycmd/linkbefore 1.26.11; 1.27.0-0 to before 1.27.41.26.11, 1.27.4Patch availableCNA
  • cmd/compile VendorGo standard library Affected before 1.26.11; 1.27.0-0 to before 1.27.4 Fixed in 1.26.11, 1.27.4 Patch available CNA
  • cmd/link VendorGo standard library Affected before 1.26.11; 1.27.0-0 to before 1.27.4 Fixed in 1.26.11, 1.27.4 Patch available CNA

Remediation

Upgrade the Go toolchain. The fixed versions are 1.26.11 and 1.27.4 for both cmd/compile and cmd/link.

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

  • Fix · CNA cmd/compile (Go toolchain) Fixed in 1.26.11, 1.27.4
  • Fix · CNA cmd/link (Go toolchain) Fixed in 1.26.11, 1.27.4

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Release ·

    Go toolchain cmd/link 1.26.11, 1.27.4

    3 records Highest priority Priority MEDIUM 3 MEDIUM

    Other records, highest priority first

    • TI-2026-89559 Crafted .syso files inject cgo linker flags in Go cmd/go and cmd/linkPriority MEDIUM 48
    • TI-2026-89561 Argument injection in Go toolchain linker flags via cgo directivesPriority MEDIUM 40
  • Release ·

    Go toolchain cmd/compile 1.26.11, 1.27.4

    3 records Highest priority Priority MEDIUM 3 MEDIUM

    Other records, highest priority first

    • TI-2026-89562 Quoting flaw in Go cgo directives allows code execution at build timePriority MEDIUM 40
    • TI-2026-89561 Argument injection in Go toolchain linker flags via cgo directivesPriority MEDIUM 40

Timeline

  1. 2026-11-11 Threatist record created from CVE-2026-97041
  2. 2026-11-11 Alias added: GHSA-537w-q924-jhpm
  3. 2026-11-16 CVSS score added · CISA ADP
  4. 2026-11-16 Weakness changed · CISA ADP
  5. 2026-11-16 CISA SSVC decision points changed

References

  • TI-2020-00578 Spoofing in Windows CryptoAPI ECC certificate validation KEVCVSS 3.1HIGH 8.1
  • TI-2023-23979 HTTP/2 request cancellation lets attackers exhaust server resources KEVCVSS 3.1HIGH 7.5
  • TI-2023-24278 HTTP/2 CONTINUATION flood in net/http CVSS 3.1HIGH 7.5
  • TI-2018-05208 The "go get" implementation in Go 1.9.4, when the -insecure command-line option is used… CVSS 3.1HIGH 8.8
  • TI-2024-16309 Panic when parsing invalid palette-color images in golang.org/x/image CVSS 3.1HIGH 7.5
  • TI-2022-20112 Request smuggling due to improper request handling in golang.org/x/net/http2/h2c CVSS 3.1HIGH 7.5
See all 309 →

Sources