# CVE-2021-23449: vm2 prototype pollution sandbox escape

Source: https://junglewise.ai/threats/cve-2021-23449-vm2-prototype-pollution-sandbox-escape  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-10-19. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2021-23449 · Severity: low · CVSS 3.1 · Published 2021-10-19

vm2 is a popular Node.js sandbox library used to safely execute untrusted code. A prototype pollution vulnerability allows attackers to break out of the sandbox and execute arbitrary code on the host system. This can lead to complete system compromise when vm2 is used to run untrusted scripts.

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

## Quick answers

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

**How severe is CVE-2021-23449?** Low severity, with a CVSS score of 3.1, published 19 October 2021.

**Which products and versions are affected?** vm2 (npm) SEMVER:introduced=0,fixed=3.9.4.

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

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

**Am I affected by CVE-2021-23449?** Check whether you run vm2 (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

- vm2 (npm): upgrade to 3.9.4 or later

  ```sh
  npm install vm2@3.9.4
  ```


## Technical details

The vulnerability is a prototype pollution attack in vm2 before version 3.9.4 that exploits the JavaScript prototype chain to escape the sandbox. The attack manipulates object prototypes to modify behavior of sandboxed code execution, allowing an attacker to override security controls and execute arbitrary code on the host machine. No authentication or special user interaction is required—malicious code executed within the vm2 sandbox can trigger the escape. The vulnerability was patched in version 3.9.4; users must upgrade immediately to remediate the risk.

## Affected products

- vm2 vm2 before 3.9.4

## Identifiers

- CVE-2021-23449
- GHSA-rjf2-j2r6-q8gr

## Timeline

- 2021-09-07: disclosed
- 2021-10-18: advisory
- 2021-10-19: patched

## References

- [https://github.com/patriksimek/vm2/issues/363](https://github.com/patriksimek/vm2/issues/363)

## Related threats

- [vm2 NodeVM path bypass in custom resolution](https://junglewise.ai/threats/duplicate-advisory-vm2-nodevm-custom-resolution-bypasses-external-path-5d3a7272)
- [vm2 NodeVM zlib buffer pool information disclosure](https://junglewise.ai/threats/duplicate-advisory-vm2-nodevm-zlib-buffers-expose-pooled-host-memory-6007c734)
- [vm2 host Promise rejection denial of service in construct trap](https://junglewise.ai/threats/duplicate-advisory-vm2-host-promise-rejection-from-an-exposed-f7aba6ba)
- [vm2 sandbox escape via Buffer backing-store ownership bypass](https://junglewise.ai/threats/cve-2026-100723-vm2-before-3-12-2-does-not-apply-its-buffer-backing-store)
- [vm2 unhandled Promise rejection in construct trap](https://junglewise.ai/threats/cve-2026-100722-vm2-before-3-12-2-does-not-apply-host-side-promise-rejection)
