{"id":"CVE-2023-39323","published":"2023-10-05T20:36:58Z","modified":"2025-06-12T15:15:12Z","title":"Arbitrary code execution during build via line directives in cmd/go","vendor":"Go toolchain","product":"cmd/go","tier":"tail","description":{"text":"Line directives (\"//line\") can be used to bypass the restrictions on \"//go:cgo_\" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running \"go build\". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.01873,"percentile":0.79902,"provenance":"source"},"cwes":[],"references":[{"url":"https://go.dev/issue/63211","tags":[]},{"url":"https://go.dev/cl/533215","tags":[]},{"url":"https://groups.google.com/g/golang-announce/c/XBa1oHDevAo","tags":[]},{"url":"https://pkg.go.dev/vuln/GO-2023-2095","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20231020-0001/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/","tags":[]},{"url":"https://security.gentoo.org/glsa/202311-09","tags":[]}],"priority":{"score":21.7,"factors":[{"name":"EPSS percentile","points":15.98},{"name":"CVSS severity","points":5.67}]},"vendorSlug":"go-toolchain","affectedVersions":[{"vendor":"Go toolchain","product":"cmd/go","versions":["< 1.20.9",">= 1.21.0-0, < 1.21.2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-06-12T15:14:25.966284Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"toolchain","vulnerableRanges":["<1.20.9",">=1.21.0-0, <1.21.2"],"patched":["1.20.9","1.21.2"],"from":["GO-2023-2095"],"provenance":"source"}],"summary":{"text":"The flaw is in the cmd/go component of the Go toolchain, where \"//line\" directives can be abused to get around the restrictions placed on \"//go:cgo_\" directives. This lets blocked linker and compiler flags be passed during compilation. An attacker who can get a crafted source file processed by \"go build\" can cause arbitrary code to execute, though exploitation is complicated because the line directive must contain the absolute path of the file that holds it, and no authentication or user interaction is stated as required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:54:36Z"},"euvd":{"id":"EUVD-2023-43055","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-29402","published":"2023-06-08","fixed":"1.20.5","kev":false,"link":{"from":"CVE-2023-29402","to":"CVE-2023-39323","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.20.5","toFixed":"1.20.9","daysApart":119}]}},{"cve":"CVE-2023-29405","published":"2023-06-08","fixed":"1.20.5","kev":false},{"cve":"CVE-2023-24531","published":"2024-07-02","fixed":"1.21.0-0","kev":false},{"cve":"CVE-2023-39320","published":"2023-09-08","fixed":"1.21.1","kev":false,"link":{"from":"CVE-2023-39320","to":"CVE-2023-39323","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.21.1","toFixed":"1.21.2","daysApart":27}]}},{"cve":"CVE-2023-39323","published":"2023-10-05","fixed":"1.21.2","kev":false},{"cve":"CVE-2023-45285","published":"2023-12-06","fixed":"1.21.5","kev":false,"link":{"from":"CVE-2023-39323","to":"CVE-2023-45285","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:toolchain","fromFixed":"1.20.9","toFixed":"1.20.12","daysApart":62}]}},{"cve":"CVE-2024-24787","published":"2024-05-08","fixed":"1.22.3","kev":false},{"cve":"CVE-2024-45340","published":"2025-01-28","fixed":"1.24.0-rc.2","kev":false}],"package":"Go:toolchain"}}