{"id":"CVE-2026-97042","aliases":["CVE-2026-97042","GO-2026-6849"],"related":["RHSA-2026:101231","RHSA-2026:102586","RHSA-2026:102587","RHSA-2026:102592","RHSA-2026:99003","RHSA-2026:99004"],"kind":"vulnerability","state":"published","title":"Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link","summary":"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 \"@\".","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 \"@\".","source":"cvelist"}],"published":"2026-11-11T02:51:11.000Z","modified":"2026-11-25T10:42:40.349Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.26.11","status":"affected"},{"type":"semver","introduced":"1.27.0-0","fixed":"1.27.4","status":"affected"}],"vendor":"Go toolchain","product":"cmd/cgo","package":"cmd/cgo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"1.26.11","status":"affected"},{"type":"semver","introduced":"1.27.0-0","fixed":"1.27.4","status":"affected"}],"vendor":"Go toolchain","product":"cmd/compile","package":"cmd/compile","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"1.26.11","status":"affected"},{"type":"semver","introduced":"1.27.0-0","fixed":"1.27.4","status":"affected"}],"vendor":"Go toolchain","product":"cmd/link","package":"cmd/link","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.11"},{"type":"semver","introduced":"1.27.0-0","status":"affected","fixed":"1.27.4"}],"ecosystem":"Go","package":"toolchain","purl":"pkg:golang/toolchain","source":"go"}],"references":[{"url":"https://go.dev/cl/862155","tags":["fix"],"sources":["cvelist","go","nvd"]},{"url":"https://go.dev/issue/82568","tags":["report"],"sources":["cvelist","go","nvd"]},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":["web"],"sources":["cvelist","go","nvd"]},{"url":"https://pkg.go.dev/vuln/GO-2026-6849","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Go","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-11-16T17:24:31.363Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-97042","url":"https://www.cve.org/CVERecord?id=CVE-2026-97042","licence":"CVE Terms of Use","modified":"2026-11-16T17:24:34.342Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6849","url":"https://pkg.go.dev/vuln/GO-2026-6849","licence":"CC-BY-4.0","modified":"2026-11-25T10:42:40.349Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-97042","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97042","licence":"Public domain","modified":"2026-11-16T18:17:34.507Z"}],"updatedAt":"2026-11-25T22:59:50.323Z","epss":{"score":0.00575,"percentile":0.48843,"date":"2026-12-02T12:00:21.000Z"}}