CVE-2026-100722

vm2 before 3.12.2 Host Process Termination via Construct Trap

Published Sep 27, 2026 CVSS 4.0 · 8.9 High EPSS < 1% KEV · Not listed
Description
vm2 before 3.12.2 does not apply host-side Promise rejection handling in the sandbox-to-host construct trap. In BaseHandler, the apply trap calls markHostPromiseHandled() on the returned value, but the adjacent construct path returns the result of Reflect.construct without the same sanitization. If an embedder exposes a constructable host function whose constructor returns a native rejected Promise, an untrusted script executed via VM.run can invoke it with `new` and ignore the result; the rejected host Promise crosses the bridge unhandled and, under Node's strict unhandled-rejection policy, is promoted to an uncaught exception that terminates the host process.

Analysis

AI-generated

Technical impact

The vulnerability exists in the vm2 sandbox library prior to version 3.12.2, where the construct trap omits host-side Promise rejection handling. When an embedder registers a constructable host function whose constructor returns a native rejected Promise, code executed in the sandbox can invoke this function with the JavaScript "new" operator, bypassing the missing sanitization. The rejected Promise propagates across the VM boundary as unhandled, and Node.js’s strict unhandled‑rejection policy causes it to be escalated to an uncaught exception, which terminates the host process. The attacker therefore gains the ability to force a sandboxed script to shut down the entire Node.js application without needing elevated privileges within the host environment.

Affected Systems

This issue affects the patriksimek:vm2 package in every release before 3.12.2. Hosts that embed vm2 and run untrusted code via VM.run or a similar API are at risk. The vulnerability is independent of the host application's version but becomes mitigated once the library is updated to 3.12.2 or later.

Risk and Exploitability

The CVSS score of 8.9 classifies the flaw as high severity. While the EPSS score is not available, the nature of the flaw—allowing sandbox code to terminate the hosting process—makes exploitation likely in environments that run unchecked VM code. The vulnerability is not listed in the CISA KEV catalog, but its impact on process availability and the ease of triggering it via a constructable host function warrant immediate attention. The most probable attack vector is the execution of untrusted JavaScript within a vm2 sandbox that can call a host function returning a rejected Promise.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade vm2 to version 3.12.2 or later to apply proper host‑Promise handling in the construct trap.
  • If upgrading is not immediately possible, ensure that any constructable host functions do not return Promise objects, or wrap them in a safe constructor that resolves normally.
  • Configure the Node.js process to avoid strict unhandled‑rejection escalation by using the --unhandled-rejections=none flag or installing a global unhandledRejection handler to contain the error level.

Generated by OpenCVE AI on September 27, 2026 at 04:00 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-2v2p-6j97-cjg9 vm2: Host Promise rejection from an exposed constructor can terminate the vm2 host process
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Patriksimek
Patriksimek vm2
Vendors & Products Patriksimek
Patriksimek vm2
Type Values Removed Values Added
Description vm2 before 3.12.2 does not apply host-side Promise rejection handling in the sandbox-to-host construct trap. In BaseHandler, the apply trap calls markHostPromiseHandled() on the returned value, but the adjacent construct path returns the result of Reflect.construct without the same sanitization. If an embedder exposes a constructable host function whose constructor returns a native rejected Promise, an untrusted script executed via VM.run can invoke it with `new` and ignore the result; the rejected host Promise crosses the bridge unhandled and, under Node's strict unhandled-rejection policy, is promoted to an uncaught exception that terminates the host process.
Title vm2 before 3.12.2 Host Process Termination via Construct Trap
Weaknesses CWE-248
References
Metrics cvssV3_1

{'score': 6.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Sep 28, 2026, 1:51 PM
Reserved
Sep 26, 2026, 2:40 AM
Status
Deferred
Published
Sep 27, 2026, 2:17 AM
Modified
Sep 28, 2026, 2:17 PM
Severity
Moderate
Public date
Sep 27, 2026, 1:28 AM