{"id":"GHSA-753c-phhg-cj29","revision":"d357c4153d0d42a1b0a8005efc8c7245","records":[{"revision":"d357c4153d0d42a1b0a8005efc8c7245","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-753c-phhg-cj29","aliases":["CVE-2021-23352","SNYK-JS-MADGE-1082875"],"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) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); });\n```","state":0,"publishedAt":"2021-03-12T23:01:49+00:00","modifiedAt":"2026-07-08T06:50:04.1973274+00:00","affected":[{"ecosystem":"npm","name":"madge","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.0.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://nvd.nist.gov/vuln/detail/CVE-2021-23352","https://github.com/pahen/madge/commit/da5cbc9ab30372d687fa7c324b22af7ffa5c6332","https://github.com/pahen/madge/blob/master/lib/graph.js#L27","https://snyk.io/vuln/SNYK-JS-MADGE-1082875"],"sourceUrl":"https://github.com/advisories/GHSA-753c-phhg-cj29","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-753c-phhg-cj29","identifiers":["GHSA-753c-phhg-cj29","CVE-2021-23352","SNYK-JS-MADGE-1082875"]},"retained":false,"historicalAffected":[]}],"coverage":[]}