Paper/Archive/CVE-2023-29405

CVE-2023-29405

Go toolchain cmd/go — Improper sanitization of LDFLAGS with embedded spaces 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. Flags containing embedded spaces are mishandled, allowing disallowed flags to be smuggled through the LDFLAGS sanitization by including them in the argument of another flag. This only affects usage of the gccgo compiler.

Affected

ProductAffectedFixed inSource
cmd/go< 1.19.101.19.10CNA
cmd/go1.20.0-0 – < 1.20.51.20.5CNA
cmd/cgo< 1.19.101.19.10CNA
cmd/cgo1.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/60306refgo.dev/cl/501224refgroups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJrefpkg.go.dev/vuln/GO-2023-1842reflists.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-20241206-0003