# CVE-2021-3757: immer prototype pollution in patch handling

Source: https://junglewise.ai/threats/cve-2021-3757-immer-prototype-pollution-in-patch-handling  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-09-07. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2021-3757 · Severity: low · CVSS 3 · Published 2021-09-07

immer is a popular JavaScript library used for managing immutable state in applications. A prototype pollution vulnerability allows attackers to modify core JavaScript object properties through specially crafted patch operations, potentially causing application-wide denial of service or unexpected behavior in all objects created after the attack.

Technologies: [immer (npm)](https://junglewise.ai/threats/technologies/immer). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2021-3757 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-3757 being exploited in the wild.

**How severe is CVE-2021-3757?** Low severity, with a CVSS score of 3, published 7 September 2021.

**Which products and versions are affected?** immer (npm) SEMVER:introduced=7.0.0,fixed=9.0.6.

**Is there a fix for CVE-2021-3757?** Yes. immer (npm): upgrade to 9.0.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2021-3757 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2021-3757?** Check whether you run immer (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- immer (npm): upgrade to 9.0.6 or later

  ```sh
  npm install immer@9.0.6
  ```


## Technical details

immer is vulnerable to prototype pollution (CWE-1321, CWE-915) in its patch handling mechanism. The vulnerability allows an attacker to pollute the Object prototype by crafting malicious patch operations with paths like `["__proto__"], "x"`. The attack is network-accessible and requires no authentication or user interaction. An attacker can modify prototype attributes on the target application, leading to denial of service or arbitrary behavior modification. The vulnerability was introduced in version 7.0.0 and is fixed in version 9.0.6.

## Affected products

- Immer immer 7.0.0 to 9.0.5

## Identifiers

- CVE-2021-3757
- GHSA-c36v-fmgq-m8hx

## Timeline

- 2021-09-07: disclosed
- 2021-09-03: patched: Fix commit: fa671e5

## References

- [https://github.com/immerjs/immer/commit/fa671e55ee9bd42ae08cc239102b665a23958237](https://github.com/immerjs/immer/commit/fa671e55ee9bd42ae08cc239102b665a23958237)

## Related threats

- [Immer prototype pollution via type confusion in applyPatches](https://junglewise.ai/threats/cve-2021-23436-immer-prototype-pollution-via-type-confusion-in-applypatches)
- [immer prototype pollution in applyPatches](https://junglewise.ai/threats/cve-2020-28477-immer-prototype-pollution-in-applypatches)
