vm2 TypedArray and ArrayBuffer prototype mutation sandbox escape

Severity: critical · CVSS 10 · Published 2026-09-17

vm2 is a JavaScript sandbox that isolates untrusted code from the host environment. Versions 3.11.0 through 3.11.7 fail to properly isolate TypedArray and ArrayBuffer prototypes, allowing attackers to modify host intrinsic objects from within the sandbox. After the sandboxed code exits, normal host code using typed arrays can be manipulated through attacker-installed properties, potentially leading to data corruption or unauthorized data access.

Technologies: vm2 (npm), Vm2. Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Critical severity, with a CVSS score of 10, published 17 September 2026.
Which products and versions are affected?
vm2 (npm) >= 3.11.0, <= 3.11.7; Vm2 3.11.0 through 3.11.7.
Is there a fix for This vulnerability?
Yes: fixed in 3.11.8. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run vm2 (npm) or Vm2 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

  • Fixed in: 3.11.8

Technical details

The vulnerability is a prototype pollution in vm2's bridge protection mechanism. The sandbox protection relies on a hardcoded list of classic globals (Object, Array, Function, etc.) but omits TypedArray and ArrayBuffer intrinsics. Attackers can use prototype-walking primitives via Buffer to reach host Uint8Array.prototype, %TypedArray%.prototype, and ArrayBuffer.prototype, then define properties that persist after VM.run() returns. The bridge's defensive infrastructure exists but is applied to an incomplete inventory of protected objects.

Affected products

  • vm2 3.11.0 through 3.11.7

Timeline

  • 2026-08-27: disclosed
  • 2026-09-17: advisory
  • 2026-10-05: other: Advisory withdrawn as duplicate of GHSA-3vgf-8m4q-q4qr

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.