{"id":"CVE-2021-23352","aliases":["CVE-2021-23352","GHSA-753c-phhg-cj29","SNYK-JS-MADGE-1082875"],"related":[],"kind":"vulnerability","state":"published","title":"Command Injection","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\n### PoC\n```js\nconst madge = require('madge'); \nmadge('..', {graphVizPath: \"touch HELLO;\"}) .then((res) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); });\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Esto afecta al paquete madge versiones anteriores a 4.0.1.&#xa0;Es posible especificar una ruta Graphviz personalizada por medio del parámetro graphVizPath option que cuando son llamadas las funciones .image(), .svg() o .dot(), es ejecutado por la función childprocess.exec","source":"nvd"}],"published":"2021-03-09T18:30:23.064Z","modified":"2026-07-08T06:50:04.197Z","severity":{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L/E:F/RL:O/RC:C","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L/E:F/RL:O/RC:C","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-77","CWE-89"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"4.0.1","status":"affected"}],"product":"madge","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.1"}],"ecosystem":"npm","package":"madge","purl":"pkg:npm/madge","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.0.1"}],"vendor":"madge_project","product":"madge","cpe":"cpe:2.3:a:madge_project:madge:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://snyk.io/vuln/SNYK-JS-MADGE-1082875","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pahen/madge/blob/master/lib/graph.js%23L27","tags":["broken-link","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23352","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pahen/madge/blob/master/lib/graph.js#L27","tags":["web"],"sources":["ghsa"]}],"credits":["Alessio Della Libera (d3lla)"],"assigner":"snyk","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-23352","url":"https://www.cve.org/CVERecord?id=CVE-2021-23352","licence":"CVE Terms of Use","modified":"2024-09-16T23:11:05.188Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-753c-phhg-cj29","url":"https://github.com/advisories/GHSA-753c-phhg-cj29","licence":"CC-BY-4.0","modified":"2026-07-08T06:50:04.197Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-23352","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23352","licence":"Public domain","modified":"2026-06-17T03:38:36.353Z"}],"updatedAt":"2026-11-25T22:58:00.207Z","epss":{"score":0.02057,"percentile":0.81849,"date":"2026-12-01T12:00:22.000Z"}}