Miggo Logo

CVE-2021-23352: Madge vulnerable to command injection

N/A

CVSS Score

Basic Information

EPSS Score
0.6926%
Published
3/12/2021
Updated
9/6/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
madgenpm< 4.0.14.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The core vulnerability exists in checkGraphvizInstalled which constructs a command using user-controlled graphVizPath and executes it via child_process.exec (vulnerable to shell injection). The .image(), .svg() and .dot() functions all trigger this vulnerable path. The commit diff shows the fix replaced exec with execFile and modified command construction, confirming the original insecure pattern. The PoC demonstrates exploitation through these entry points.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T*is *****ts t** p**k*** m**** ***or* *.*.*. It is possi*l* to sp**i*y * *ustom *r*p*viz p*t* vi* t** *r*p*VizP*t* option p*r*m*t*r w*i**, w**n t** .im***(), .sv*() or .*ot() *un*tions *r* **ll**, is *x**ut** *y t** **il*pro**ss.*x** *un*tion. ### P

Reasoning

T** *or* vuln*r**ility *xists in ****k*r*p*vizInst*ll** w*i** *onstru*ts * *omm*n* usin* us*r-*ontroll** *r*p*VizP*t* *n* *x**ut*s it vi* **il*_pro**ss.*x** (vuln*r**l* to s**ll inj**tion). T** .im***(), .sv*() *n* .*ot() *un*tions *ll tri***r t*is v