# CVE-2023-39323: Arbitrary code execution during build via line directives in cmd/go

- Severity: High 8.1 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.91%, higher than 80% of CVEs (2026-12-01)
- Published: 2023-10-05T20:35:05.000Z
- Modified: 2026-09-08T08:47:48.505Z
- Also known as: GO-2023-2095, BIT-GOLANG-2023-39323
- Related: CGA-h68p-xhgj-4g85
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Go

## Description

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.

(As written by CVE List.)

## Affected

- cmd/go: before 1.20.9; from 1.21.0-0 before 1.21.2
- toolchain (Go): before 1.20.9; from 1.21.0-0 before 1.21.2
- golang go: before 1.20.9; from 1.21.0 before 1.21.2
- fedoraproject fedora: 37; 38; 39
- golang (Bitnami): before 1.20.9; from 1.21.0 before 1.21.2

## Every score

- CISA-ADP: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://go.dev/issue/63211> (fix, issue-tracking, patch, report)
- <https://go.dev/cl/533215> (fix, patch)
- <https://groups.google.com/g/golang-announce/c/XBa1oHDevAo> (discussion, mailing-list, release-notes, web)
- <https://pkg.go.dev/vuln/GO-2023-2095> (advisory, vendor-advisory)
- <https://security.netapp.com/advisory/ntap-20231020-0001/> (advisory, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/> (advisory, mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/> (advisory, mailing-list, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/> (advisory, mailing-list, third-party-advisory)
- <https://security.gentoo.org/glsa/202311-09> (advisory, third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-39323> (web)

## Sources

- CVE List: [CVE-2023-39323](https://www.cve.org/CVERecord?id=CVE-2023-39323), CVE Terms of Use, modified 2025-06-12
- Go Vulnerability Database: [GO-2023-2095](https://pkg.go.dev/vuln/GO-2023-2095), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-39323](https://nvd.nist.gov/vuln/detail/CVE-2023-39323), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-39323](https://osv.dev/vulnerability/BIT-GOLANG-2023-39323), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2023-39323 · Whole record: https://cve.day/CVE-2023-39323.json · Rebuilt by cve.day 2026-11-25T22:58:28.488Z
