Miggo Logo

CVE-2023-29404:
The go command may execute arbitrary code at build time when using cgo. This may occur when...

9.8

CVSS Score

Basic Information

EPSS Score
-
Published
6/8/2023
Updated
1/6/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the improper sanitization of LDFLAGS directives used with cgo. The provided patch commit 356a419e2f811b65d227abcea1a346f8dcb154e0 modifies the regular expressions in validLinkerFlags within src/cmd/go/internal/work/security.go. These regexes are used by the checkLinkerFlags function in the same file to validate linker flags. The changes make the validation stricter, specifically for flags like -Wl,-O, -Wl,-e, and -Wl,-R, ensuring they are followed by mandatory arguments. This directly addresses the vulnerability described, where non-optional arguments were treated as optional, allowing flag smuggling. Therefore, cmd/go/internal/work.checkLinkerFlags is the function that, prior to the patch, would process and incorrectly sanitize the malicious input, making it the key vulnerable function in the runtime profile during exploitation.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** *o *omm*n* m*y *x**ut* *r*itr*ry *o** *t *uil* tim* w**n usin* **o. T*is m*y o**ur w**n runnin* "*o **t" on * m*li*ious mo*ul*, or w**n runnin* *ny ot**r *omm*n* w*i** *uil*s untrust** *o**. T*is is **n *y tri***r** *y link*r *l**s, sp**i*i** vi*

Reasoning

T** vuln*r**ility li*s in t** improp*r s*nitiz*tion o* L**L**S *ir**tiv*s us** wit* **o. T** provi*** p*t** *ommit `****************************************` mo*i*i*s t** r**ul*r *xpr*ssions in `v*li*Link*r*l**s` wit*in `sr*/*m*/*o/int*rn*l/work/s**u