---
id: "CVE-2026-97038"
page: "https://infrastack.ai/live/CVE-2026-97038"
kind: "vulnerability"
aliases: ["CVE-2026-97038", "GO-2026-6853"]
title: "Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/go"
severity: "high"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "toolchain", "fixed": ["1.26.11", "1.27.4"], "affected": ">= 1.27.0-0, < 1.27.4", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["build-servers", "cgo", "ci", "go", "package"]
not_affected_if: ["no-cgo", "toolchain-upgraded", "trusted-deps-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:56+00:00"
sources: [{"source": "govuln", "url": "https://pkg.go.dev/vuln/GO-2026-6853", "first_seen_at": "2026-11-11T03:37:17+00:00"}]
exploit_sources: []
---

# Arbitrary code execution via crafted .syso files and cgo linker input files in cmd/go

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

A Go package containing crafted .syso files or cgo linker inputs can inject linker flags or run code while the project is built. The attacker gets code execution on the machine or CI runner that compiles the malicious package.

_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` and confirm the toolchain is below `1.26.11` on the 1.26 line or below `1.27.4` on the 1.27 line.
- Check whether the project or its dependencies use cgo or ship .syso files.

## Fix

- Go toolchain 1.27.x: upgrade to `1.27.4`
- Go toolchain 1.26.x: upgrade to `1.26.11`

## Timeline

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

## From the sources

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 "LC_LINKER_OPTION" 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, "LC_LINKER_OPTION" load commands, or LTO IR sections, and disallows "-l:<filename>" and ":", "=", or path separators in "-l" flags.

---

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