CVE-2021-23436: Prototype Pollution in immer
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.30227%
CWE
Published
9/2/2021
Updated
4/30/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
immer | npm | >= 7.0.0, < 9.0.6 | 9.0.6 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from path element processing in applyPatches_ where path[i] could be an array (e.g., ['proto']). The strict equality check (p === 'proto') fails because array vs string type mismatch, allowing prototype pollution. The patch converts path[i] to string ('' + path[i]), confirming the vulnerable code was in this path processing loop. The test case added in tests/patch.js directly targets this scenario, and the CVE description explicitly references the applyPatches_ function's condition check as the vulnerable point.