CVE-2021-23352: Madge vulnerable to command injection
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.6926%
CWE
Published
3/12/2021
Updated
9/6/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
-
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
madge | npm | < 4.0.1 | 4.0.1 |
Vulnerability Intelligence
Miggo AI
Root 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.