CVE-2026-44005: vm2: Sandbox escape

Published May 7, 2026
·
Updated

Summary vm2's bridge exposes mutable proxies for real host-realm intrinsic prototypes and then forwards sandbox writes into the underlying host objects with otherReflectSet() and otherReflectDefineProperty(), which lets attacker-controlled JavaScript running in a default VM or inherited NodeVM mutate shared host Object.prototype, Array.prototype, and Function.prototype from inside the sandbox.

Details BaseHandler.apply() unwraps sandbox-controlled receivers and arguments with otherFromThis() / otherFromThisArguments() and then directly invokes the real host function with ret = otherReflectApply(object, context, args), so any default-exposed host function that can surface a prototype getter becomes a prototype-walking primitive (lib/bridge.js:665-676). BaseHandler.get() special-cases proto and returns the host-side descriptor or proxy target prototype, which is enough for the attacker to reuse the host lookupGetter('proto') accessor repeatedly until the walk lands on host Object.prototype, Array.prototype, or Function.prototype (lib/bridge.js:590-616). Once the attacker has a proxy to a host intrinsic prototype, BaseHandler.set() performs value = otherFromThis(value); return otherReflectSet(object, key, value) === true;, which writes attacker-controlled data directly into the shared host object instead of keeping the mutation sandbox-local; BaseHandler.defineProperty() repeats the same design at otherReflectDefineProperty(object, prop, otherDesc) for descriptor-based writes (lib/bridge.js:641-649, lib/bridge.js:753-774). Existing validation does not stop the attack because the constructor filter only blocks one dangerous-property access pattern, setPrototypeOf() only blocks prototype replacement rather than ordinary property assignment, and containsDangerousConstructor() only protects one later re-unwrapping path instead of the initial host-prototype write sink (lib/bridge.js:494-530, lib/bridge.js:595-610, lib/bridge.js:660-662).

PoC Run the following code snippet and observe that the value of vm2EscapeMarker is polluted: const { VM } = require('vm2'); const vm = new VM(); vm.run( const g = ({}).lookupGetter; const a = Buffer.apply; const p = a.apply(g, [Buffer, ['proto']]); const hostObjectProto = p.call(p.call(p.call(p.call(Buffer.of())))); hostObjectProto.vm2EscapeMarker = 'polluted-object-prototype'; ); console.log({}.vm2EscapeMarker)

Impact Sandbox escape and prototype pollution.

Other sources

vm2 is an open source vm/sandbox for Node.js. From 3.9.6 to 3.10.5, vm2's bridge exposes mutable proxies for real host-realm intrinsic prototypes and then forwards sandbox writes into the underlying host objects with otherReflectSet() and otherReflectDefineProperty(), which lets attacker-controlled JavaScript running in a default VM or inherited NodeVM mutate shared host Object.prototype, Array.prototype, and Function.prototype from inside the sandbox This vulnerability is fixed in 3.11.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/vm2>=3.9.6<=3.10.5
3.11.0
Vm2 Project Vm2 Node.js>=3.9.6<3.11.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/vm2 to a version that resolves this vulnerability.

    Fixed in 3.11.0
  2. Upgrade

    Upgrade vm2 to a version that resolves this vulnerability.

    Fixed in 3.11.0
  3. Operational

    After upgrading vm2, verify sandbox integrity by rerunning the provided snippet (including checking that `console.log({}.vm2EscapeMarker)` is not polluted) to confirm the prototype pollution/sandbox escape behavior is resolved.

Event History

May 7, 2026
Advisory Published
via GitHub·04:07 AM
Data Sourced
via GitHub·04:07 AM
DescriptionSeverityWeaknessAffected Software
May 13, 2026
CVE Published
via MITRE·05:40 PM
Data Sourced
via MITRE·05:40 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·06:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-44005?

CVE-2026-44005 has a moderate severity rating due to the potential for unauthorized access to underlying host objects.

2

How do I fix CVE-2026-44005?

To fix CVE-2026-44005, you should upgrade the vm2 package to version 3.11.0 or later.

3

Which versions of vm2 are affected by CVE-2026-44005?

CVE-2026-44005 affects vm2 versions between 3.9.6 and 3.10.5, inclusive.

4

What is the nature of the vulnerability in CVE-2026-44005?

CVE-2026-44005 allows attacker-controlled JavaScript to manipulate real host-realm intrinsic prototypes via mutable proxies.

5

Is CVE-2026-44005 specific to a certain environment?

CVE-2026-44005 is specifically relevant in environments using default VM or inherited NodeVM in conjunction with vm2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203