vm2 sandbox bypass via accessor descriptor in freeze/readonly

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

vm2 is a JavaScript sandbox that allows running untrusted code in isolation. A vulnerability in versions 3.9.6 through 3.11.6 allows attackers to bypass the vm.freeze() and vm.readonly() protections and modify properties that the application explicitly marked read-only. This could enable attackers to alter critical configurations or manipulate host application behavior.

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 4, published 17 September 2026.
Which products and versions are affected?
vm2 (npm) >= 3.9.6, <= 3.11.6; Vm2 3.9.6 to 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, 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.

Technical details

The vulnerability exists in vm2's ReadOnlyHandler, which fails to intercept accessor property descriptors retrieved via Object.getOwnPropertyDescriptor() or __lookupSetter__(). A sandboxed script can extract the host object's setter and invoke it directly, bypassing the readonly proxy wrapper. The attack requires no special VM options; only that the embedder froze an object containing at least one accessor own-property.

Affected products

  • vm2 3.9.6 to 3.11.6

Timeline

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

References

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