Detect vm2 Sandbox Escape via node:test.run() execArgv Builtin Allowlist Bypass (CVE-2026-92948) in Elastic Security
Detects exploitation and presence of CVE-2026-92948, a critical (CVSS 9.9) sandbox escape in the vm2 JavaScript sandbox library (versions >= 3.9.6, <= 3.11.6). The NodeVM builtin allowlist can be bypassed by abusing the `node:test` module's `run()` function, which accepts an `execArgv` option. Because vm2 permitted access to `node:test` and did not sanitize `execArgv`, an attacker could inject Node.js command-line flags (e.g. `--experimental-...`, `--require`, or `--eval` style arguments) into a child test runner process, breaking out of the sandbox and achieving arbitrary code execution on the host. This CWE-693 (Protection Mechanism Failure) flaw is fixed in vm2 3.11.7. Note vm2 is deprecated upstream; detection focuses on identifying vulnerable installs and runtime indicators of child-process/escape behavior originating from node processes that embed vm2.
MITRE ATT&CK
Elastic Detection Query
// df00tech DF00-b907b994e8 · https://df00tech.com/detections/CVE-2026-92948 · licence: https://df00tech.com/detections/licence
process where event.type == "start" and
process.name in ("node", "node.exe") and
process.parent.name in ("node", "node.exe") and
(
process.command_line : "*--test*" or
process.command_line : "*--experimental-test-isolation*" or
process.command_line : "*--require*" or
process.command_line : "*--import*" or
process.command_line : "*node:test*" or
process.command_line : "*execArgv*" or
process.command_line : "*--eval*"
) Elastic EQL rule matching node child processes launched with execArgv/test-runner flags consistent with the vm2 node:test sandbox escape.
Data Sources
Required Tables
False Positives & Tuning
- Automated test execution in CI using the native node test runner.
- Developer workstations running node:test suites.
- Transpiler/loader re-spawns using --require or --import.
Other platforms for CVE-2026-92948
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Install vulnerable vm2 version
Expected signal: npm install process creation and filesystem writes under /tmp/vm2-cve-test/node_modules/vm2; version string 3.11.6 printed.
- Test 2 Simulate node:test execArgv child spawn
Expected signal: Process-creation events showing node spawning a child node process with --test / --experimental-test-isolation / execArgv / --eval on the command line.
- Test 3 Windows node:test execArgv simulation
Expected signal: Sysmon Event ID 1 showing node.exe parent spawning node.exe child with --test / --experimental-test-isolation / execArgv flags.
References (6)
- https://github.com/patriksimek/vm2/security/advisories/GHSA-qhwx-74w5-xhxq
- https://nvd.nist.gov/vuln/detail/CVE-2026-92948
- https://github.com/patriksimek/vm2/commit/415339f698f0d52d3c5ad358b12b79c8072d5b4b
- https://github.com/patriksimek/vm2/releases/tag/v3.11.7
- https://www.vulncheck.com/advisories/vm2-3.9.6-through-3.11.5-sandbox-escape-via-node-test
- https://github.com/advisories/GHSA-qhwx-74w5-xhxq
Response Playbook
Triage
- Confirm whether the affected host runs a Node.js application that depends on vm2. Run `npm ls vm2` / `grep -r "vm2" package-lock.json yarn.lock pnpm-lock.yaml` across deployed app directories and check whether the resolved version falls within >= 3.9.6 and <= 3.11.6.
- Review the flagged process tree: confirm the parent node process is the sandbox host and the child node process was launched with execArgv-style flags (--test, --require, --import, --eval, node:test). Capture the full command line and the user context.
- Determine whether the vm2 sandbox in this application evaluates untrusted/attacker-supplied code (e.g. user-submitted scripts, plugin systems, templating). If it only runs trusted first-party code, exploitability is sharply lower.
- Correlate the event timestamp with inbound requests to the application (web/API logs) to identify whether a specific request payload triggered the sandbox evaluation.
Containment
- Upgrade vm2 to 3.11.7 or later; where feasible, migrate off vm2 entirely (it is deprecated) to `isolated-vm` or a separate hardened runtime, since vm2 has a long history of escapes.
- If immediate patching is not possible, isolate or take the exposed application offline, or disable the code-evaluation feature that feeds untrusted input into the vm2 NodeVM sandbox.
- Block/kill the offending child node process and quarantine the host if post-exploitation activity (new persistence, outbound C2, credential access) is observed.
Evidence Collection
- Preserve full process-creation telemetry for the parent and child node processes, including complete command lines, environment, and working directory.
- Capture the application's request logs and any stored untrusted script/payload that was passed into the vm2 sandbox around the event time.
- Snapshot the host filesystem artifacts: node_modules/vm2 version, package-lock, and any files written by the escaped process; collect memory image if active compromise is suspected.
Escalation Criteria
- !Escalate to IR immediately if the child node process shows post-escape behavior: spawning shells, writing to startup/persistence locations, outbound network connections to unknown hosts, or credential/secret access.
- !Escalate if the vulnerable vm2 sandbox is confirmed to evaluate attacker-controllable input on an internet-facing service.
- !Escalate if evidence shows the event correlates with an external request payload matching known PoC patterns (GHSA-qhwx-74w5-xhxq).
Investigation Guide
Forensic Artifacts
- >
node_modules/vm2 package version (package.json/package-lock.json) within the affected version range. - >
Process-creation records showing node spawning node with --test/--require/--import/execArgv flags. - >
Application request logs containing the untrusted script payload passed to NodeVM. - >
Files written or modified by the escaped child process outside the application's normal working set.
Tuning Guidance
Baseline legitimate use of the native Node.js test runner in your environment (CI agents, developer workstations, build hosts) and exclude those hosts/service accounts to cut noise. The native `--test` flag alone is extremely common and benign; prioritize alerts where the parent node process corresponds to a known vm2-embedding application rather than a test harness, and where the child spawn originates from a production service account. Where possible, enrich with the `npm ls vm2` inventory so alerts fire preferentially on hosts with a vulnerable vm2 version installed.
Hunting Queries
Hunt for node-on-node process chains carrying the distinctive node:test / execArgv indicators of the vm2 escape, broadened beyond the primary rule's flag set.
// df00tech DF00-b907b994e8 · https://df00tech.com/detections/CVE-2026-92948 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("node.exe","node") and FileName in~ ("node.exe","node") and ProcessCommandLine has_any ("node:test","execArgv","--experimental-test-isolation") | project Timestamp, DeviceName, InitiatingProcessCommandLine, ProcessCommandLine ``` df00tech DF00-b907b994e8 · https://df00tech.com/detections/CVE-2026-92948 · licence: https://df00tech.com/detections/licence ```
index=* (process_name=node OR process_name=node.exe) parent_process_name=node* | search process="*node:test*" OR process="*execArgv*" OR process="*--experimental-test-isolation*" | stats count by host, user, process Atomic Red Team Tests
Install a vm2 version within the affected range to validate inventory-based detection and software composition scanning.
Command
mkdir -p /tmp/vm2-cve-test && cd /tmp/vm2-cve-test && npm init -y >/dev/null 2>&1 && npm install [email protected] >/dev/null 2>&1 && node -e "console.log(require('vm2/package.json').version)" Cleanup
rm -rf /tmp/vm2-cve-test Expected Telemetry
npm install process creation and filesystem writes under /tmp/vm2-cve-test/node_modules/vm2; version string 3.11.6 printed.
Expected Detection
Software inventory / SCA detects [email protected] within the vulnerable range >= 3.9.6, <= 3.11.6.
Launch a node process that invokes the native test runner with custom execArgv, producing the node-on-node process-creation telemetry the rules key on (benign simulation of the escape's observable behavior).
Command
cd /tmp && node -e "const {run}=require('node:test'); run({files:[], execArgv:['--eval','process.stdout.write(\"escaped\")']}).on('test:stderr',()=>{});" ; node --test --experimental-test-isolation=process -e "1" 2>/dev/null || true Cleanup
echo 'no cleanup required' Expected Telemetry
Process-creation events showing node spawning a child node process with --test / --experimental-test-isolation / execArgv / --eval on the command line.
Expected Detection
Rule matches node parent spawning node child with execArgv/node:test/--test indicators.
Windows equivalent that spawns a child node process via the native test runner with execArgv to generate detectable process telemetry.
Command
node.exe -e "const {run}=require('node:test'); try{run({files:[],execArgv:['--eval','process.stdout.write(String(1))']});}catch(e){}" & node.exe --test --experimental-test-isolation=process Cleanup
echo no cleanup required Expected Telemetry
Sysmon Event ID 1 showing node.exe parent spawning node.exe child with --test / --experimental-test-isolation / execArgv flags.
Expected Detection
KQL/Sysmon rule matches node.exe-on-node.exe creation with execArgv/test-runner indicators.