Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 2%. Fixed in 1.19.10 and 1.20.5.
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
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Go toolchain | <1.19.10, >=1.20.0-0 <1.20.5 | 1.19.10, 1.20.5 |
Timeline
Every event on this vulnerability
Embed
A live severity badge for an advisory, README or ticket