CVE-2026-24118: VM2 Sandbox Breakout via __lookupGetter__ Method

vm2 Updated 05 May 2026

Summary

04/05/2026
Yes i
Critical
9.8

CVE-2026-24118: VM2 Sandbox Breakout Through lookupGetter. Affects vm2 versions < 3.11.0. Fixed in 3.11.0. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 preventing access to the host system. However, a critical vulnerability has been identified that allows attackers to escape this sandbox, leading to potential remote code execution.

Vulnerability Detail

The vulnerability arises from the __lookupGetter__ method, which can be exploited to access host context properties from within the VM2 sandbox. By using the host apply method accessible through Buffer, an attacker can invoke the host version of __lookupGetter__. This allows them to retrieve the host's Function.prototype and execute arbitrary code, including accessing sensitive system resources. The issue was partially addressed in a previous fix, but can still be circumvented using Object.getOwnPropertyDescriptor to access the constructor property.

How To Fix

Latest published version: 3.12.2 as of 22 Oct 2026

npm install vm2@3.12.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.11.0

This is the first release that contains the fix.

npm install vm2@3.11.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the __lookupGetter__ method within the VM2 sandbox until you can update to the patched version. Additionally, consider restricting the use of VM2 in environments where untrusted code execution is not absolutely necessary.

Conclusion

The VM2 package has a critical vulnerability that allows sandbox breakout through the __lookupGetter__ method. It is essential to update to version 3.11.0 or later to mitigate this risk. Users should also consider using Vulert for ongoing monitoring of vulnerabilities in their applications.

See every vulnerability recorded for vm2 →

Share this vulnerability

FAQ

The CVSS score for this vulnerability is 9.8, indicating a critical level of severity.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit the Vulert playground at Vulert Scanner to check if your application is affected without needing to sign up.

If exploited, this vulnerability allows attackers to execute arbitrary commands on the host system, leading to potential data breaches or system compromise.

Yes, version 3.11.0 and later of VM2 has addressed this vulnerability and is safe to use.

If you cannot update VM2 right away, avoid using the __lookupGetter__ method in your code and limit the execution of untrusted code in the VM2 environment.

Related vulnerabilities

Recent vulnerabilities recorded for vm2.

How To Fix

Latest published version: 3.12.2 as of 22 Oct 2026

npm install vm2@3.12.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.11.0

This is the first release that contains the fix.

npm install vm2@3.11.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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