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, cmd/link: cgo directive injection via .syso files disguised as Go object files #82570
Building a package containing a crafted ".syso" file could bypass cgo flag
validation and inject arbitrary linker flags when linking.
When loading ".syso" entries from a package archive, the linker only checked for
recognized host object headers (ELF, Mach-O, PE, and XCOFF) before falling
through to Go object parsing. A ".syso" file beginning with a "go object" header
was parsed as a Go compiler object, allowing untrusted cgo metadata directives
(such as "cgo_ldflag" or "cgo_dynamic_linker") embedded in the ".syso" file to
be passed to the external linker without validation. Additionally, ".syso"
filenames longer than 16 bytes lost their ".syso" extension when truncated in
archive headers, and unrecognized ".syso" formats forced external linking in
pure-Go builds.
The linker now rejects ".syso" files that are not recognized host object
formats, and "cmd/go" and "cmd/pack" preserve the ".syso" suffix when truncating
long archive member names.
Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.
Change https://go.dev/cl/861530 mentions this issue: [release-branch.go1.26] cmd/go, cmd/link: reject .syso files with Go object or unrecognized formats
Change https://go.dev/cl/861491 mentions this issue: [release-branch.go1.27] cmd/go, cmd/link: reject .syso files with Go object or unrecognized formats
changed the title [-]security: fix CVE-2026-97040[/-][+]cmd/go, cmd/link: cgo directive injection via .syso files disguised as Go object files[/+]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: #82585 (for 1.26), #82586 (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/861530 mentions this issue:
[release-branch.go1.26] cmd/go, cmd/link: reject .syso files with Go object or unrecognized formatsgopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/861491 mentions this issue:
[release-branch.go1.27] cmd/go, cmd/link: reject .syso files with Go object or unrecognized formats[release-branch.go1.27] cmd/go, cmd/link: reject .syso files with Go …
[release-branch.go1.26] cmd/go, cmd/link: reject .syso files with Go …
[-]security: fix CVE-2026-97040[/-][+]cmd/go, cmd/link: cgo directive injection via .syso files disguised as Go object files[/+]gopherbot commentedon Nov 10, 2026
Change https://go.dev/cl/862153 mentions this issue:
cmd/go, cmd/link: reject .syso files with Go object or unrecognized formatscmd/go, cmd/link: reject .syso files with Go object or unrecognized f…