Paper/Archive/CVE-2023-29404

CVE-2023-29404

Go toolchain cmd/go — Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go

Description · from the CVE record

The go command may execute arbitrary code at build time when using cgo. This may occur when running "go get" on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a "#cgo LDFLAGS" directive. The arguments for a number of flags which are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization. This affects usage of both the gc and gccgo compilers.

Affected

ProductAffectedFixed inSource
cmd/go< 1.19.101.19.10CNA
cmd/go1.20.0-0 – < 1.20.51.20.5CNA

Scores by source

CISA ADP9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CISA ADPSSVCExploitation: none · Automatable: yes · Technical impact: total

References

refgo.dev/issue/60305refgo.dev/cl/501225refgroups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJrefpkg.go.dev/vuln/GO-2023-1841reflists.fedoraproject.org/archives/list/[email protected]/message/XBS3IIK6ADV24C5ULQU55QLT2UE762ZXreflists.fedoraproject.org/archives/list/[email protected]/message/NZ2O6YCO2IZMZJELQGZYR2WAUNEDLYV6refsecurity.gentoo.org/glsa/202311-09refsecurity.netapp.com/advisory/ntap-20241115-0009