CVE-2023-29405

Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go

Critical · published June 8, 2023

CVSS v3.1
9.8
EPSS
2%
Percentile
77.2
In the wild
Unconfirmed
What it is

🔥 A sneaky vulnerability in the Go command could let malicious code slip right through when building untrusted code! Think of this as a chef who trusts an unfamiliar delivery person to bring ingredients. If they mislabel an item, the chef might end up using something dangerous without a second thought, all because the delivery wasn’t properly checked! An attacker could potentially execute arbitrary code during the build process, leading to catastrophic consequences like full system compromise. Imagine having your entire system taken over just by running a seemingly innocent command—absolutely devastating!

Put simply

Think of this as a chef who trusts an unfamiliar delivery person to bring ingredients. If they mislabel an item, the chef might end up using something dangerous without a second thought, all because the delivery wasn’t properly checked! This vulnerability occurs when using the gccgo compiler, where the linker flags specified via a '#cgo LDFLAGS' directive can be exploited. If these flags contain embedded spaces, they can bypass sanitization, allowing unauthorized flags to sneak in.

What to do

An attacker could potentially execute arbitrary code during the build process, leading to catastrophic consequences like full system compromise. Imagine having your entire system taken over just by running a seemingly innocent command—absolutely devastating! Patch your Go installation to the latest version that addresses this vulnerability, and avoid using untrusted modules with 'go get'. Review all build processes to ensure no untrusted code is executed. Protect your systems proactively! You've got this! Follow these steps, and you'll be well on your way to securing your Go environment! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01714 · 77.2th percentile
Published
2023-06-08T20:19Z
EPSS history
Timeline
  • 08 JUN 20:19Z
    Improper sanitization of LDFLAGS with embedded spaces in go command with cgo in cmd/go
    cvelistv5