{"affected":[{"defaultStatus":"unaffected","ecosystem":"https://pkg.go.dev","packageName":"cmd/cgo","product":"cmd/cgo","source":"CNA: Go","vendor":"Go toolchain","versions":[{"lessThan":"1.26.11","status":"affected","version":"0","versionType":"semver"},{"lessThan":"1.27.4","status":"affected","version":"1.27.0-0","versionType":"semver"}]},{"defaultStatus":"unaffected","ecosystem":"https://pkg.go.dev","packageName":"cmd/compile","product":"cmd/compile","source":"CNA: Go","vendor":"Go toolchain","versions":[{"lessThan":"1.26.11","status":"affected","version":"0","versionType":"semver"},{"lessThan":"1.27.4","status":"affected","version":"1.27.0-0","versionType":"semver"}]},{"defaultStatus":"unaffected","ecosystem":"https://pkg.go.dev","packageName":"cmd/link","product":"cmd/link","source":"CNA: Go","vendor":"Go toolchain","versions":[{"lessThan":"1.26.11","status":"affected","version":"0","versionType":"semver"},{"lessThan":"1.27.4","status":"affected","version":"1.27.0-0","versionType":"semver"}]}],"cveId":"CVE-2026-97042","cwes":["CWE-88"],"description":"Building a malicious package that uses \"//go:cgo_import_dynamic\" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in \"//go:cgo_import_dynamic\" directives and skipped validation in cgo-generated files. In addition, on Windows, \"cmd/cgo\" and \"cmd/link\" did not validate imported DLL names extracted from PE object files before emitting \"-l<name>\" flags for the external linker, allowing a crafted DLL name containing \"..\" path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in \"//go:cgo_import_dynamic\" directives (including in cgo-generated files on Windows) and rejects \"..\" path traversal, and \"cmd/cgo\" and \"cmd/link\" reject PE imported DLL names containing path separators, \"..\", \":\", or leading \"-\" or \"@\".","epss":null,"exploits":[],"kev":null,"metrics":[],"modifiedAt":1794366795060,"publishedAt":1794366795060,"references":[{"source":"CNA: Go","tags":[],"url":"https://go.dev/cl/862155"},{"source":"CNA: Go","tags":[],"url":"https://go.dev/issue/82568"},{"source":"CNA: Go","tags":[],"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM"},{"source":"CNA: Go","tags":[],"url":"https://pkg.go.dev/vuln/GO-2026-6849"}],"remediation":[],"revision":"3339056d08e7e6670b1d7153cd196d39d40995f2b30961722cb1fbfac91fef60","sources":[{"modifiedAt":1794366795060,"name":"CNA: Go","retrievedAt":1794370201681,"url":"https://www.cve.org/CVERecord?id=CVE-2026-97042"}],"ssvc":null,"status":"published","title":"Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link","updatedAt":1794370201681}