CVE-2023-29404

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

Critical · published June 8, 2023

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

🚨 An untrusted module can execute arbitrary code in your build process, and that’s a major risk! 🔥 Think of it like a contractor who decides to add their own secret blueprints mid-construction without your consent — you could end up with a house that collapses! With this vulnerability, an attacker could smuggle in malicious code during the build process, potentially compromising your entire application. If an unsuspecting developer runs ‘go get’ on a rogue module, they could unwittingly empower the attacker to execute any code they desire, leading to catastrophic security breaches.

Put simply

Think of it like a contractor who decides to add their own secret blueprints mid-construction without your consent — you could end up with a house that collapses! CVE-2023-29404 allows arbitrary code execution at build time due to mismanaged linker flags in the Go programming language. The sanitization for certain LDFLAGS directives fails, treating mandatory flags as optional, which opens the door for malicious arguments to be executed.

What to do

With this vulnerability, an attacker could smuggle in malicious code during the build process, potentially compromising your entire application. If an unsuspecting developer runs ‘go get’ on a rogue module, they could unwittingly empower the attacker to execute any code they desire, leading to catastrophic security breaches. Immediately upgrade your Go environment to the latest version where this vulnerability is patched. Avoid using untrusted modules and audit your existing modules to ensure none are compromised. Implement strict code review policies for any builds involving cgo and LDFLAGS. This is fixable! Stay proactive, apply the updates, and you'll keep your codebase secure! 🛡️

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.01822 · 78.6th percentile
Published
2023-06-08T20:19Z
EPSS history
Timeline
  • 08 JUN 20:19Z
    Improper handling of non-optional LDFLAGS in go command with cgo in cmd/go
    cvelistv5