CVE-2021-3757: Prototype Pollution in immer
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.31142%
CWE
Published
9/7/2021
Updated
4/25/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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 stemmed from how path elements were processed in the patching mechanism. The key change in the fix was coercing path[i] to a string ("" + path[i]), indicating the original code accepted non-string path elements. This allowed malicious paths like [["proto"], "x"] where the array ["proto"] wasn't properly converted to a string key, enabling prototype pollution. The test case added in patch.js verifies this specific attack vector is blocked after the fix.