What’s Vulnerable › Vulnerabilities
CVE-2021-23352: Command Injection
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.1% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-03-09 · updated 2026-06-17
- Weakness: CWE-89
Description
This affects the package madge before 4.0.1. It is possible to specify a custom Graphviz path via the graphVizPath option parameter which when the .image(), .svg() or .dot() functions are called, is executed by the childprocess.exec function.
Affected products
- madge: before 4.0.1 — fixed in 4.0.1
How to fix
Upgrade to a fixed version: madge 4.0.1. Check the vendor advisory for mitigations.
References
- https://github.com/pahen/madge/blob/master/lib/graph.js%23L27
- https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332
- https://snyk.io/vuln/SNYK-JS-MADGE-1082875
- https://github.com/pahen/madge/blob/master/lib/graph.js%23L27
- https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332
- https://snyk.io/vuln/SNYK-JS-MADGE-1082875
Get alerted when CVE-2021-23352 or the next vulnerability affects your stack