CVE-2026-92942

vm2 before 3.11.7 Timeout Bypass via FinalizationRegistry

Published Sep 17, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
vm2 before 3.11.7 (affected versions <= 3.11.6) does not enforce the VM({ timeout }) option on code executed outside the synchronous VM#run() call. The timeout only wraps the single call to _runScript() via doWithTimeout() in lib/vm.js, and FinalizationRegistry and WeakRef are exposed to sandboxed code unmodified (they are not among the hardened globals in lib/setup-sandbox.js). Sandboxed code can register a FinalizationRegistry cleanup callback against an object and then drop the only strong reference to it; vm.run() returns within the configured timeout, but when the V8 garbage collector later reclaims the object it invokes the sandboxed cleanup callback outside any vm2 timeout accounting. A busy loop in that callback blocks the host event loop for an unbounded period, resulting in denial of service. The time of invocation depends on the garbage collector (e.g. under memory pressure or with --expose-gc).

Analysis

AI-generated

Technical impact

vm2 before version 3.11.6 does not enforce the VM({ timeout }) option on code that runs outside the synchronous VM#run() call. The timeout wrapper only covers the single call to _runScript() and FinalizationRegistry and WeakRef are exposed to sandboxed code unchanged. A sandboxed script can register a cleanup callback with a FinalizationRegistry and then drop the only strong reference to the associated object. When V8 later reclaims the object, the registered callback is invoked outside any vm2 timeout accounting. If that callback contains a busy loop, it blocks the host event loop for an unlimited period, resulting in a denial‑of‑service. It is inferred that the attacker needs the ability to execute arbitrary code within the vm2 sandbox and must have a way to trigger garbage collection, either by allocating large objects or using the --expose‑gc flag.

Affected Systems

Vendors affected are those using the patriksimek vm2 package at or below version 3.11.6. The package is updated to 3.11.7 in a release that applies the timeout to all sandboxed code. No other vendors or products are listed in the CVE data.

Risk and Exploitability

The CVSS score of 8.7 signals a high‑severity flaw. Because the EPSS score is not available, the probability of exploitation cannot be quantified, but the vulnerability is reported as not listed in CISA KEV. It is inferred that the attacker must be able to execute arbitrary code within the vm2 sandbox and must have the capability to trigger garbage collection. The likely attack path involves an attacker providing malicious code to a vulnerable vm2 instance, registering a cleanup callback that loops indefinitely, and waiting for garbage collection to execute the callback outside the configured timeout, thereby blocking the host process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the vm2 package to version 3.11.7 or newer, which enforces the timeout across all sandboxed code.
  • If an upgrade is not immediately possible, reconfigure the sandbox to exclude the FinalizationRegistry and WeakRef globals so that sandboxed scripts cannot register cleanup callbacks.
  • Apply defensive coding by avoiding infinite loops in any cleanup callbacks and monitor the event loop to detect long‑running operations.

Generated by OpenCVE AI on September 18, 2026 at 00:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-r4fx-v8hh-22mv vm2: timeout Option Bypass via FinalizationRegistry Cleanup Callback (Unbounded Host Event-Loop Block)
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', '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.11.7 (affected versions <= 3.11.6) does not enforce the VM({ timeout }) option on code executed outside the synchronous VM#run() call. The timeout only wraps the single call to _runScript() via doWithTimeout() in lib/vm.js, and FinalizationRegistry and WeakRef are exposed to sandboxed code unmodified (they are not among the hardened globals in lib/setup-sandbox.js). Sandboxed code can register a FinalizationRegistry cleanup callback against an object and then drop the only strong reference to it; vm.run() returns within the configured timeout, but when the V8 garbage collector later reclaims the object it invokes the sandboxed cleanup callback outside any vm2 timeout accounting. A busy loop in that callback blocks the host event loop for an unbounded period, resulting in denial of service. The time of invocation depends on the garbage collector (e.g. under memory pressure or with --expose-gc).
Title vm2 before 3.11.7 Timeout Bypass via FinalizationRegistry
Weaknesses CWE-400
References
Metrics cvssV3_1

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

cvssV4_0

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

Weaknesses
  • CWE-1100

    Insufficient Isolation of System-Dependent Functions

  • CWE-400

    Uncontrolled Resource Consumption

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Sep 18, 2026, 7:34 PM
Reserved
Sep 17, 2026, 12:42 PM
Status
Deferred
Published
Sep 17, 2026, 2:17 PM
Modified
Sep 18, 2026, 8:17 PM
Severity
Important
Public date
Sep 17, 2026, 1:46 PM