org.mvnpm:mpath@0.5.2

  • latest version

    0.9.0

  • latest non vulnerable version

  • first published

    4 months ago

  • latest version published

    4 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:mpath 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

    org.mvnpm:mpath is a package that gets/sets javascript object values using MongoDB-like path notation.

    Affected versions of this package are vulnerable to Prototype Pollution. A type confusion vulnerability can lead to a bypass of CVE-2018-16490. In particular, the condition ignoreProperties.indexOf(parts[i]) !== -1 returns -1 if parts[i] is ['__proto__']. This is because the method that has been called if the input is an array is Array.prototype.indexOf() and not String.prototype.indexOf(). They behave differently depending on the type of the input.

    PoC

    const mpath = require('mpath');
    // mpath.set(['__proto__', 'polluted'], 'yes', {});
    // console.log(polluted); // ReferenceError: polluted is not defined
    
    mpath.set([['__proto__'], 'polluted'], 'yes', {});
    console.log(polluted); // yes
    

    How to fix Prototype Pollution?

    Upgrade org.mvnpm:mpath to version 0.9.0 or higher.

    [,0.9.0)