Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
CriticalPublic exploit

vm2 sandbox escape via __lookupGetter__

IdentifiersCVE-2026-24118CWE-94· Improper Control of Generation of…

CVE-2026-24118 is a critical sandbox breakout vulnerability in the vm2 Node.js sandbox library affecting versions prior to 3.11.0, including versions up to and including 3.10.4. The flaw allows attacker-supplied JavaScript executed inside a vm2 sandbox to escape the intended isolation boundary and reach host-context functionality. Supporting reporting attributes the escape to inconsistent context bridging involving lookupGetter, Buffer.apply, and prototype-chain traversal, which can expose host-side objects up to Object.prototype, then the host Object constructor, and ultimately the host Function constructor. Once the host Function constructor is reachable, arbitrary code can be created and executed in the host context, defeating vm2's sandbox model. Public descriptions note that exploitation can be used to invoke host capabilities such as child_process and execute arbitrary operating system commands. The issue was patched in vm2 version 3.11.0.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation results in complete sandbox escape and arbitrary command execution on the underlying host system with the privileges of the Node.js process running vm2. This can lead to total compromise of confidentiality, integrity, and availability for resources accessible to that process, including environment variables, application secrets, credentials, local files, and the ability to modify application state or disrupt service. In multi-tenant or code-execution environments, the flaw can also enable lateral movement or further compromise of adjacent internal systems reachable from the host.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, do not rely on vm2 as the sole security boundary for executing fully untrusted code. Restrict or suspend untrusted code execution paths that feed user-controlled JavaScript into vm2. Run the hosting Node.js service with minimal OS privileges, isolate it from sensitive files, secrets, and internal network segments, and monitor for indicators such as unexpected child process creation, suspicious use of .constructor.constructor, dynamic Function construction, or sandbox payloads combining lookupGetter with Buffer.apply. Additional containment using stronger isolation layers such as containers or microVM-style sandboxing can reduce exposure until patching is completed.

Remediation

Patch, then assume compromise.

Upgrade vm2 to version 3.11.0 or later. The provided content states the vulnerability is patched in 3.11.0, and later releases such as 3.11.2 are available. Organizations should identify all direct and transitive dependencies on vm2 and update vulnerable installations through normal dependency management and software composition analysis workflows. After upgrading, validate that the deployed package version is no longer earlier than 3.11.0 and retest any functionality that executes untrusted code.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2026-24118MaturityPoCVerified exploit

This repository is a small self-contained JavaScript proof-of-concept for escaping a vulnerable vm2 sandbox in a local lab environment. It contains two code files: lab.js, which creates an Express-based test service exposing POST /execute on localhost:3000 and runs supplied code inside a vm2 VM configured with sandbox {}, timeout 4000, and eval disabled; and exploit.js, which sends a crafted JavaScript payload to that endpoint using fetch. The exploit’s core capability is sandbox escape leading to host-side arbitrary command execution. The payload creates an Error object, sets err.name to a Symbol, invokes an async function returning err.stack, and in the promise rejection path accesses e.constructor.constructor to recover the host Function constructor. It then executes host JavaScript that imports child_process via process.mainModule.require('child_process') and runs shell commands on the underlying system. On success it prints markers plus the output of whoami and id, creates a timestamped proof file in /tmp, and appends an exploitation log entry to /tmp/vm2_lab.log. The repository is not part of a larger exploit framework; it is a standalone operational PoC with a hardcoded target and payload. The README and license are disclaimers only. The exploit is aimed at a deliberately vulnerable local Node.js lab using vm2 version 3.10.1. It is not merely a detector: it actively exploits the sandbox and demonstrates post-escape command execution. A commented section in exploit.js also shows how the payload could be replaced with a bash reverse shell callback to 127.0.0.1:4444, indicating the exploit can be adapted beyond simple proof-file creation.

HORKimhabDisclosed May 7, 2026javascriptmarkdownlocalnetworkweb
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Vm2 ProjectVm2application

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity6

Community discussion across Reddit, Mastodon, and other social sources.