GO-2026-6853: Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/go

Published Nov 11, 2026
·
Updated

Building a malicious package containing ".syso" files or cgo linker inputs could inject arbitrary linker flags or execute arbitrary code at link time.

Linker input files—including ".syso" files, direct object or library inputs in "#cgo LDFLAGS", and libraries in "-L" directories—were passed to the external linker without validating their format or checking for embedded linker options. Across platforms, this allowed executing GNU ld implicit linker scripts disguised as libraries or ".syso" files (or loaded via "-l:<filename>" or "-l" containing path separators), injecting unallowlisted linker flags via PE/COFF ".drectve" sections on Windows or Mach-O "LCLINKEROPTION" load commands on Darwin, or invoking LTO plugins via GCC or LLVM LTO intermediate representation sections in ELF, PE/COFF, or Mach-O objects.

The go command now verifies that ".syso" files, direct linker inputs, and libraries in "-L" directories are valid binary objects or archives that do not contain unallowlisted ".drectve" directives, "LCLINKEROPTION" load commands, or LTO IR sections, and disallows "-l:<filename>" and ":", "=", or path separators in "-l" flags.

Affected Software

2 affected componentsFixes available
go/toolchain<1.26.11
1.26.11
go/toolchain>=1.27.0-0<1.27.4
1.27.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/toolchain to a version that resolves this vulnerability.

    Fixed in 1.26.11
  2. Upgrade

    Upgrade go/toolchain to a version that resolves this vulnerability.

    Fixed in 1.27.4

Event History

Nov 11, 2026
Advisory Published
via OSV·02:51 AM
Data Sourced
via OSV·02:51 AM
DescriptionAffected Software

Frequently Asked Questions

1

Who is realistically exposed to this issue?

Build environments that compile untrusted or third-party Go packages are exposed when those packages can supply .syso files or cgo linker inputs. The risk occurs during linking, so CI systems and developer workstations that build such packages are relevant targets.

2

What does an attacker need to control to exploit it?

An attacker needs to cause a target to build a malicious package containing crafted .syso files, direct object or library inputs in #cgo LDFLAGS, or libraries found through -L directories. The crafted input can exploit linker-script handling, embedded linker options, or LTO intermediate-representation sections.

3

What can be done before an updated toolchain is available?

Do not build untrusted packages that include .syso files or cgo linker inputs. In particular, review or reject direct linker inputs, libraries supplied through -L directories, and -l flags using a colon, equals sign, or path separators.

4

Which kinds of embedded linker behavior are relevant on different platforms?

GNU ld implicit linker scripts can be disguised as libraries or .syso files across platforms. Windows PE/COFF .drectve sections and Darwin Mach-O LC_LINKER_OPTION commands can inject linker options, while LTO IR sections in ELF, PE/COFF, or Mach-O objects can invoke GCC or LLVM LTO plugins.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203