{"id":"CVE-2021-23352","aliases":["EUVD-2021-0621","GHSA-753c-phhg-cj29","SNYK-JS-MADGE-1082875"],"status":"published","title":"Command Injection","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.","severity":{"version":"3.1","score":8.6,"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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.02057,"percentile":0.81439,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-77","CWE-89"],"published":"2021-03-09T18:30:23Z","modified":"2026-10-20T10:53:37Z","fixes":[{"ecosystem":"npm","package":"madge","fixed_in":["4.0.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"madge","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.1"}]}]},{"source":"osv","ecosystem":"npm","package":"madge","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.0.1"}]}]}],"products":[{"vendor":"madge_project","product":"madge"}],"references":[{"url":"https://snyk.io/vuln/SNYK-JS-MADGE-1082875","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/pahen/madge/blob/master/lib/graph.js%23L27","tags":["x_refsource_MISC","x_transferred","Broken Link","Third Party Advisory","advisory"]},{"url":"https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-23352","tags":["advisory"]},{"url":"https://github.com/pahen/madge/blob/master/lib/graph.js#L27","tags":["web"]},{"url":"https://github.com/advisories/GHSA-753c-phhg-cj29"}],"sources":{"cve":[{"id":"CVE-2021-23352","title":"Command Injection","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.","status":"published","published":"2021-03-09T18:30:23.064Z","modified":"2024-09-16T23:11:05.188Z","cvss":[{"version":"3.1","score":8.6,"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","level":"high","assessor":"cna"}],"updated_at":"2026-11-02T14:33:00.819444Z"}],"euvd":[{"id":"EUVD-2021-0621","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.","status":"published","published":"2021-03-09T18:30:23Z","modified":"2024-09-16T23:11:05Z","cvss":[{"version":"3.1","score":8.6,"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","level":"high"}],"updated_at":"2026-11-03T00:54:56.209754Z"}],"ghsa":[{"id":"GHSA-753c-phhg-cj29","title":"Madge vulnerable to command injection","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.\n\n### PoC\n```js\nconst madge = require('madge'); \nmadge('..', {graphVizPath: \"touch HELLO;\"}) .then((res) =\u003e res.svg()) .then((writtenImagePath) =\u003e { console.log('Image written to ' + writtenImagePath); });\n```","status":"published","published":"2021-03-12T23:01:49Z","modified":"2023-09-06T23:33:12Z","cwes":["CWE-77","CWE-89"],"updated_at":"2026-11-02T14:37:02.632342Z"}],"nvd":[{"id":"CVE-2021-23352","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.","status":"published","published":"2021-03-09T19:15:12.86Z","modified":"2026-06-17T03:38:36.353Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:06:50.399901Z"}],"osv":[{"id":"CVE-2021-23352","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.","status":"published","published":"2021-03-09T19:15:12.86Z","modified":"2026-10-20T10:53:37.544790332Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:44:18.367807Z"},{"id":"GHSA-753c-phhg-cj29","title":"Madge vulnerable to command injection","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.\n\n### PoC\n```js\nconst madge = require('madge'); \nmadge('..', {graphVizPath: \"touch HELLO;\"}) .then((res) =\u003e res.svg()) .then((writtenImagePath) =\u003e { console.log('Image written to ' + writtenImagePath); });\n```","status":"published","published":"2021-03-12T23:01:49Z","modified":"2026-07-08T06:50:04.197327423Z","cwes":["CWE-77","CWE-89"],"updated_at":"2026-11-02T15:46:40.657155Z"}]}}
