CVE Catalog

CVE-2026-92942

HighCVSS 7.5
Published: Updated: Translated: NVD NIST

Summary

In vm2 versions ≤ 3.11.6, the VM({ timeout }) option is not enforced for code executed outside the synchronous VM#run() call. Sandboxed code can register a FinalizationRegistry callback and, after dropping an object reference, block the host event loop indefinitely, causing denial of service.

Risk Assessment

An attacker can cause service disruption by blocking the Node.js event loop, leading to unavailability of the application.

Recommendation

Upgrade vm2 to version 3.11.7 or later that fixes this issue. Limit trust in code executed in the sandbox.

Other vulnerabilities in vm2

See all
Original NVD description (English source)

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).

Vulnerability data from NVD (NIST) · CISA KEV · EPSS