Summary
vm2: Host-returned Promise rejection can bypass vm2's unhandled-rejection hardening and terminate the host process
vm2 current head (v3.11.5, commit 7a1f5100b96f48d34e0fe104ab37c0acc5944f92) can still be used to terminate the host Node.js process when sandbox code calls a host-realm function that returns a rejected host Promise and then ignores the returned value.
This is an incomplete-fix variant of the GHSA-hw58-p9xv-2mjh unhandled rejection hardening. The localPromise constructor now catches and consumes sandbox-created unhandled rejections, but host Promises returned across the bridge are not marked handled at the bridge boundary. If the sandbox does not attach .catch() or .then(..., onRejected), Node's default unhandled rejection behavior terminates the host process.
Technical Details
lib/setup-sandbox.js hardens sandbox-created Promises by wrapping the executor and attaching a benign swallow tail:
apply(globalPromisePrototypeThen, this, [undefined, localPromiseSwallow]);
That only applies to localPromise instances created inside the sandbox.
Host-returned Promises cross the membrane through the bridge apply path. The bridge wraps callbacks when sandbox code later calls .then, .catch, or .finally on a host Promise:
bridge.setHostPromiseSanitizers(e => handleException(from(e)), from);
However, if sandbox code ignores the returned host Promise, no host-side rejection handler is attached. The original host Promise remains unhandled and Node terminates the host process under the default unhandled-rejection behavior.
NodeVM provides an in-repository example of this primitive through the special events builtin wrapper. lib/builtin.js passes host EventEmitter.once into the sandbox:
once: EventEmitter.once,
Then lib/events.js re-exports it:
if (host.once) module.exports.once = host.once;
Calling events.once(ee, 'message') and then emitting error on ee returns a rejected host Promise through that wrapper. If ignored by sandbox code, it terminates the host process.
Affected Package/Versions
Confirmed affected on Node.js v25.8.0:
v3.10.0v3.10.1v3.10.2v3.10.3v3.10.4v3.10.5v3.11.0v3.11.1v3.11.2v3.11.3v3.11.4v3.11.5/ current head7a1f5100b96f48d34e0fe104ab37c0acc5944f92
The final PoV was also reproduced on current head with Node.js v16.20.2, v18.20.8, v20.20.2, v22.22.3, v24.16.0, and v25.9.0 using npx node@<major>. The local workstation default Node.js v25.8.0 also reproduces.
Configuration Required
The general VM PoV requires an embedder-exposed host function that can return a rejected host Promise:
const vm = new VM({
sandbox: {
hostReject: () => Promise.reject(new Error('host-boom')),
},
});
The NodeVM variant requires events in the builtin allowlist:
new NodeVM({ require: { external: false, builtin: ['events'] } });
events.once() is exposed by vm2's special events builtin wrapper. Node's official API documents events.once() as returning a Promise that rejects when the watched emitter emits error while waiting for another event.
Controls
- If sandbox code attaches
.catch(() => {})to the returned host Promise, the process survives. - If sandbox code creates and ignores a sandbox-native rejected Promise, the process survives on current head. This confirms the
GHSA-hw58localPromise hardening is active. - If sandbox code attaches
.catch(() => {})to theevents.once()Promise, theNodeVMprocess survives. - If
NodeVMdoes not allow theeventsbuiltin, theevents.once()variant does not run and the process survives.
Disclosure Policy Fit
vm2's security policy asks reporters not to open public issues and to submit This report is intended for that private route and includes the requested reproduction steps, affected versions, environment/configuration details, and impact. The affected range is within the supported 3.x line.
Local Proof of Concept
Run from the oss-zero-day-harness directory:
node submission-bundle/vm2-pov-test-host-promise-return-unhandled-rejection-dos/pov-host-promise-return-unhandled-rejection-dos.js
The crash-safe PoV executes each case in a child process. A vulnerable result has status: 1 for the positive cases and status: 0 for controls.
Minimal VM positive case:
const { VM } = require('vm2');
const vm = new VM({
sandbox: {
hostReject: () => Promise.reject(new Error('host-boom')),
},
});
vm.run('hostReject(); 1');
setTimeout(() => console.log('survived'), 150);
Observed on current head:
Error: host-boom
at hostReject (...)
The process exits before printing survived.
Minimal NodeVM builtin variant:
const { NodeVM } = require('vm2');
const vm = new NodeVM({
require: { external: false, builtin: ['events'] },
});
vm.run(`
const events = require('events');
const ee = new events.EventEmitter();
events.once(ee, 'message');
ee.emit('error', new Error('event-boom'));
module.exports = 'returned';
`, 'events-pov.js');
setTimeout(() => console.log('survived'), 150);
Observed on current head:
node:internal/process/promises:332
triggerUncaughtException(err, true /* fromPromise */);
Error: event-boom
The process exits with status 1.
Mitigation
Applications can reduce exposure by installing a process-level unhandledRejection handler that swallows vm2-originated rejections, as the README recommends for related async rejection caveats. That is an application workaround, not a library-level fix: without such a handler, current Node's default --unhandled-rejections=throw behavior raises the rejection as an uncaught exception and exits the process.
Suggested Fix Direction
When a host function call returns a host-realm Promise across the bridge into sandbox code, attach a benign host-side rejection handler to the raw returned Promise before wrapping it for the sandbox. This should mark the original host Promise handled without changing the value returned to sandbox code or hiding the rejection from sandbox code that later attaches its own .catch() / .then(..., onRejected).
Regression tests should cover:
VMwithhostReject: () => Promise.reject(new Error(...)); callinghostReject()without.catch()must not terminate the process.- The same call with a sandbox
.catch()must still deliver a sanitized rejection to the sandbox callback. NodeVMwithrequire.builtin: ['events']; callingevents.once(ee, 'message')and then emittingerrorwithout.catch()must not terminate the process.- The same
events.once()call with a sandbox.catch()must continue to deliver a sanitized rejection to the sandbox callback. - Sandbox-created rejected Promises should continue to be consumed by the existing localPromise hardening.
Why This Is Not Intended Behavior
vm2 already treats this failure mode as security-relevant. GHSA-hw58-p9xv-2mjh was assigned High severity for a sandbox-created unhandled rejection that terminated the host process, and current setup-sandbox.js explicitly states that the local Promise swallow tail exists so the host's unhandledRejection event never fires.
This report shows the same availability boundary failure still exists for host-returned Promises:
- the sandbox does not need
child_process, filesystem, network,nesting, or dangerous builtins; - the
VMvariant needs only a common embedder pattern: exposing an async host helper to untrusted code; - the
NodeVMvariant needs only the documentedeventsbuiltin allowlist; - a single sandbox call terminates the whole host process serving all users.
This is distinct from the documented caveat that timeout cannot stop CPU loops. It is also distinct from the README's current async-function / await using caveat: this report does not require sandbox async syntax, async functions, disposable stacks, or V8 stack-formatting behavior. The issue is specifically that vm2's own bridge returns a host Promise to the sandbox without marking the host Promise handled, while the sandbox-created Promise path does mark rejections handled.
This is also distinct from host-Promise callback sanitizer escapes. In those chains, sandbox code attaches a callback to a host Promise and then receives or returns a mis-sanitized value. Here, no sandbox Promise callback is required at all; the original host Promise is simply left orphaned after crossing the bridge.
Impact
An attacker who can run code in a vm2 sandbox can terminate the host Node.js process when the embedder exposes a host Promise-returning API, or when a NodeVM permits the events builtin.
For web services, queues, notebook workers, plugin hosts, and multi-tenant code execution systems, a single small request can terminate the worker process. Restart policies do not fully mitigate the issue because the payload can be replayed after each restart.
CVE-2026-92954 has a CVSS score of 8.6 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.11.8); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-92954? CVE-2026-92954 is a critical-severity security vulnerability in vm2 (npm), affecting versions >= 3.10.0, <= 3.11.7. It is fixed in 3.11.8.
- How severe is CVE-2026-92954? CVE-2026-92954 has a CVSS score of 8.6 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of vm2 are affected by CVE-2026-92954? vm2 (npm) versions >= 3.10.0, <= 3.11.7 is affected.
- Is there a fix for CVE-2026-92954? Yes. CVE-2026-92954 is fixed in 3.11.8. Upgrade to this version or later.
- Is CVE-2026-92954 exploitable, and should I be worried? Whether CVE-2026-92954 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-92954 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-92954? Upgrade
vm2to 3.11.8 or later.