Unbounded Host Event-Loop Block in vm2: Timeout Option Bypass Vulnerability

vm2 Updated 06 Oct 2026

Summary

17/09/2026
HIGH
No i
High
7.5

GHSA-vjcv-9j33-wj62: Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-r4fx-v8hh-22mv. Affects vm2 versions < 3.11.6. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

vm2 is a popular Node.js package that provides a sandboxed environment for executing JavaScript code securely. It allows developers to run untrusted code while maintaining control over the execution context. However, certain versions of vm2 are vulnerable to a timeout option bypass, which can lead to denial of service due to unbounded blocking of the host event loop.

Vulnerability Detail

The vulnerability arises from the fact that vm2 versions prior to 3.11.7 do not enforce the VM({ timeout }) option on code executed outside the synchronous VM#run() call. Specifically, the timeout only applies to the _runScript() method, and the FinalizationRegistry and WeakRef are exposed to sandboxed code without modification. This allows sandboxed code to register a cleanup callback that can block the host event loop indefinitely when the garbage collector reclaims the object, leading to a denial of service. The issue is exacerbated by the unpredictable nature of garbage collection, which can vary based on memory pressure or specific runtime flags.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using FinalizationRegistry and WeakRef in your sandboxed code until you can upgrade to the patched version of vm2. This will help mitigate the risk of blocking the host event loop.

Conclusion

The vm2 package has a significant vulnerability that allows for a timeout option bypass, potentially leading to denial of service. It is crucial for developers using affected versions to upgrade to 3.11.7 or later to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor for vulnerabilities in real-time.

See every vulnerability recorded for vm2 →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

vm2 versions 3.11.6 and earlier are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.

The vulnerability can lead to denial of service, as the host event loop can be blocked indefinitely by malicious sandboxed code.

Yes, as a temporary measure, avoid using FinalizationRegistry and WeakRef in your sandboxed code until you can upgrade to the patched version.

Related vulnerabilities

Recent vulnerabilities recorded for vm2.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback