vm2 sandbox escape via incomplete symbol filtering

Severity: medium · CVSS 6.8 · Published 2026-09-17

vm2 is a Node.js sandbox execution environment used to safely run untrusted code. Versions 3.11.4–3.11.6 fail to block certain Node.js internal symbols, allowing sandboxed code to corrupt the state of host WebStream objects and bypass stream-consumption checks—potentially allowing a sandboxed script to reuse consumed streams or hand unsafe streams to other host components.

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?
Medium severity, with a CVSS score of 6.8, published 17 September 2026.
Which products and versions are affected?
vm2 (npm) >= 3.11.4, <= 3.11.6; Vm2 3.11.4 through 3.11.6.
Is there a fix for This vulnerability?
A patch was published on 2026: Fixed in version 3.11.7 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.
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.

Technical details

vm2's symbol filtering in lib/setup-sandbox.js and lib/bridge.js uses a hardcoded list of dangerous Node.js-registered symbols but omits nodejs.stream.disturbed and nodejs.stream.errored, which are exposed on WebStream prototypes in Node.js v25.8.0+. Sandbox code can extract these real host symbols via Object.getOwnPropertySymbols() and use them as write keys on host stream objects, corrupting internal state—for example, making stream.Readable.isDisturbed() return false for an already-consumed stream. Exploitation requires the embedder to expose host WebStream objects and the stream/web module to the sandbox, but does not achieve host code execution. Fixed in vm2 3.11.7.

Affected products

  • vm2 3.11.4 through 3.11.6

Timeline

  • 2026-09-17: disclosed
  • 2026: patched: Fixed in version 3.11.7

References

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