CVE-2026-97040

NameCVE-2026-97040
DescriptionBuilding 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.
SourceCVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
golang-1.19 (PTS)bookworm1.19.8-2vulnerable
golang-1.24 (PTS)trixie1.24.4-1vulnerable
golang-1.26 (PTS)forky, sid1.26.11-1fixed
golang-1.27 (PTS)forky, sid1.27.4-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
golang-1.19source(unstable)(unfixed)
golang-1.24source(unstable)(unfixed)
golang-1.26source(unstable)1.26.11-1
golang-1.27source(unstable)1.27.4-1

Notes

[trixie] - golang-1.24 <no-dsa> (Minor issue)
[bookworm] - golang-1.19 <postponed> (Limited support, minor issue, follow trixie DSAs/point-releases)
https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM/m/KsU1KfWgAQAJ
https://github.com/golang/go/issues/82570
https://github.com/golang/go/commit/b207530349f4407d7534645681cb23c164ff217b (go1.27.4)
https://github.com/golang/go/commit/c8fc31064879b461e0fd86f4aa1dc3cbe3a42d84 (go1.26.11)

Search for package or bug name: Reporting problems