madge
Affected
- introduced
0, fixed4.0.1(semver)
Fixed versions
4.0.1
Fix
- Fixed version
4.0.1npm install [email protected]
Advisory
Also known as: CVE-2021-23352, SNYK-JS-MADGE-1082875
Madge vulnerable to command injection
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
const madge = require('madge');
madge('..', {graphVizPath: "touch HELLO;"}) .then((res) => res.svg()) .then((writtenImagePath) => { console.log('Image written to ' + writtenImagePath); });High Basis: The source's own band: HIGH
0, fixed 4.0.1 (semver)4.0.1
4.0.1npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0