You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/go: arbitrary command execution via GCC spec files in cgo linker search directories #82576
When using GCC, building a malicious package that uses cgo could cause arbitrary
command execution at link time via untrusted GCC spec files ("specs" or
"*.spec").
When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS",
GCC's built-in link spec evaluates "%:include(libgomp.spec)" or
"%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot
directories (including subdirectories and multilib sibling directories such as
"../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is
used or when "-fsanitize=" is combined with "-static" or "-static-lib*".
The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories
(and the working and package directories when applicable) that contain GCC spec
files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values.
This issue was found by the Go Security Team during an internal audit.
changed the title [-]security: fix CVE-2026-97034[/-][+]cmd/go: arbitrary command execution via GCC spec files in cgo linker search directories[/+]on Nov 10, 2026
Activity
nicholashusin commentedon Oct 26, 2026
Hi @gopherbot, please open backport issues for this security issue.
gopherbot commentedon Oct 26, 2026
Backport issue(s) opened: #82597 (for 1.26), #82598 (for 1.27).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
gopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/861524 mentions this issue:
[release-branch.go1.26] cmd/go: reject GCC spec files in linker search directoriesgopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/861485 mentions this issue:
[release-branch.go1.27] cmd/go: reject GCC spec files in linker search directories[release-branch.go1.27] cmd/go: reject GCC spec files in linker searc…
[release-branch.go1.26] cmd/go: reject GCC spec files in linker searc…
[-]security: fix CVE-2026-97034[/-][+]cmd/go: arbitrary command execution via GCC spec files in cgo linker search directories[/+]gopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/862147 mentions this issue:
cmd/go: reject GCC spec files in linker search directoriescmd/go: reject GCC spec files in linker search directories