CVE-2023-39323: 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.
High CVSS 8.1
- CVE id
- CVE-2023-39323
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Go Runtimes and servers |
< 1.20.9 >= 1.21.0, < 1.21.2 |
1.20.9, 1.21.2 |
How to fix it
Upgrade Go to the fixed release of the line you run: 1.20.9, 1.21.2.
go version
- Build with the patched Go release (set "toolchain" in go.mod, or the golang image tag) and redeploy: Go programs include the standard library, so they must be rebuilt.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
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.
References
- CVE-2023-39323 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-39323
- Web: https://go.dev/cl/533215
- Web: https://go.dev/issue/63211
- Web: https://groups.google.com/g/golang-announce/c/XBa1oHDevAo
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
- Web: https://pkg.go.dev/vuln/GO-2023-2095
- Web: https://security.gentoo.org/glsa/202311-09
- Web: https://security.netapp.com/advisory/ntap-20231020-0001/
- Web: https://go.dev/cl/533215
- Web: https://go.dev/issue/63211
- Web: https://groups.google.com/g/golang-announce/c/XBa1oHDevAo
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
- Web: https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
- Web: https://pkg.go.dev/vuln/GO-2023-2095
- Web: https://security.gentoo.org/glsa/202311-09
- Web: https://security.netapp.com/advisory/ntap-20231020-0001/
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.