CVE-2021-23352
Madge vulnerable to command injection
EPSS 0.63%
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. ### PoC ```js const madge = require('madge'); madge('..', {graphVizPath: "touch HELLO;"}) .then((res) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); }); ```
How to fix CVE-2021-23352
To remediate CVE-2021-23352, upgrade the affected package to a fixed version below.
- —upgrade to 4.0.1 or later
Is CVE-2021-23352 being exploited?
Low — EPSS is 0.6%, meaning exploitation activity has not been observed at scale.
Affected packages (1)
- from 0, < 4.0.1