{"id":"CVE-2026-97042","aliases":["GO-2026-6849"],"title":"Linker flag injection via cgo_import_dynamic and PE DLL names in cmd/cgo, cmd/compile, and cmd/link","titleSource":"Go","descriptionSource":"OSV","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.\n\nThe 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.\n\nThe 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 \"@\".","severity":"unknown","score":null,"published":"2026-11-11T02:51:11.000Z","modified":"2026-11-11T03:15:14.799Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Go","name":"toolchain","sources":[{"name":"OSV · GO-2026-6849","url":"https://osv.dev/vulnerability/GO-2026-6849"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.26.11"},{"introduced":"1.27.0-0"},{"fixed":"1.27.4"}],"type":"SEMVER"}],"versions":[],"fixed":["1.26.11","1.27.4"]}],"sourceAffected":[],"references":["https://go.dev/cl/862155","https://go.dev/issue/82568","https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","https://pkg.go.dev/vuln/GO-2026-6849"],"sources":[{"name":"CVE","id":"CVE-2026-97042","modified":"2026-11-11T03:13:15.060Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-97042"},{"name":"OSV","id":"GO-2026-6849","modified":"2026-11-11T03:15:14.799110962Z","url":"https://osv.dev/vulnerability/GO-2026-6849"}],"assessments":[],"cve":{"records":[{"id":"CVE-2026-97042","source":"Go","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-09-23T23:05:04.987Z","published":"2026-11-11T03:13:15.060Z","modified":"2026-11-11T03:13:15.060Z"}],"publishers":[{"name":"Go","role":"CNA","organizationId":"1bb62c36-49e3-4200-9d77-64a1400537cc","modified":"2026-11-11T03:13:15.060Z"}],"references":[{"url":"https://go.dev/cl/862155","tags":[],"source":"Go"},{"url":"https://go.dev/issue/82568","tags":[],"source":"Go"},{"url":"https://groups.google.com/g/golang-announce/c/iY8TY0wWgbM","tags":[],"source":"Go"},{"url":"https://pkg.go.dev/vuln/GO-2026-6849","tags":[],"source":"Go"}],"weaknesses":[],"applicability":[],"prioritization":[]},"products":[{"vendor":"Go toolchain","name":"cmd/cgo","platforms":[],"versions":[{"version":"0","status":"affected","lessThan":"1.26.11","versionType":"semver"},{"version":"1.27.0-0","status":"affected","lessThan":"1.27.4","versionType":"semver"}],"defaultStatus":"unaffected","cpes":[],"source":"Go","url":"https://www.cve.org/CVERecord?id=CVE-2026-97042"},{"vendor":"Go toolchain","name":"cmd/compile","platforms":[],"versions":[{"version":"0","status":"affected","lessThan":"1.26.11","versionType":"semver"},{"version":"1.27.0-0","status":"affected","lessThan":"1.27.4","versionType":"semver"}],"defaultStatus":"unaffected","cpes":[],"source":"Go","url":"https://www.cve.org/CVERecord?id=CVE-2026-97042"},{"vendor":"Go toolchain","name":"cmd/link","platforms":[],"versions":[{"version":"0","status":"affected","lessThan":"1.26.11","versionType":"semver"},{"version":"1.27.0-0","status":"affected","lessThan":"1.27.4","versionType":"semver"}],"defaultStatus":"unaffected","cpes":[],"source":"Go","url":"https://www.cve.org/CVERecord?id=CVE-2026-97042"}],"remediation":[],"observedAt":"2026-11-11T06:56:06.128Z","kev":{"status":"not-listed","checkedAt":"2026-11-14T23:35:33.875Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-11T07:35:34.492Z","attemptedAt":"2026-11-11T07:35:34.492Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-11T07:35:34.955Z","attemptedAt":"2026-11-11T07:35:34.955Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-11T07:35:35.532Z","attemptedAt":"2026-11-11T07:35:35.532Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-11T07:35:34.561Z","attemptedAt":"2026-11-11T07:35:34.561Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-97042","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97042","modified":"2026-11-11T05:19:58.563","checkedAt":"2026-11-11T07:35:34.492Z"},{"source":"GitHub Advisory Database","id":"GHSA-jgj7-3254-vwmv","url":"https://github.com/advisories/GHSA-jgj7-3254-vwmv","modified":"2026-11-11T06:32:48Z","checkedAt":"2026-11-11T07:35:34.955Z"},{"source":"ENISA EUVD","id":"EUVD-2026-123103","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-123103","modified":"Nov 11, 2026, 6:32:39 AM","checkedAt":"2026-11-11T07:35:35.532Z"}],"aiSummary":null}