undefsafe@0.0.2 vulnerabilities

Undefined safe way of extracting object properties

  • latest version

    2.0.5

  • latest non vulnerable version

  • first published

    12 years ago

  • latest version published

    4 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the undefsafe 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
    • M
    Prototype Pollution

    undefsafe is a Simple function for retrieving deep object properties without getting "Cannot read property 'X' of undefined".

    Affected versions of this package are vulnerable to Prototype Pollution. The a function could be tricked into adding or modifying properties of Object.prototype using a __proto__ payload.

    PoC by JHU System Security Lab

    var a = require("undefsafe");
    var payload = "__proto__.toString";
    a({},payload,"JHU");
    console.log({}.toString);
    

    How to fix Prototype Pollution?

    Upgrade undefsafe to version 2.0.3 or higher.

    <2.0.3