Critical Authorization Bypass in vm2 Package Leading to Sandbox Escape

vm2 Updated 06 Oct 2026

Summary

27/09/2026
CRITICAL
Yes i
Critical
9.0

GHSA-c9wr-qm7p-p6vc: Duplicate Advisory: vm2: NodeVM custom resolution bypasses external path boundaries. Affects vm2 versions < 3.12.2. Fixed in 3.12.2. 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

The vm2 package is a widely used Node.js library that provides a secure sandbox for executing untrusted code. It allows developers to run JavaScript code in a controlled environment, isolating it from the host application. This feature is crucial for applications that need to execute user-generated code safely. However, a critical vulnerability has been identified in versions prior to 3.12.2, which could allow unauthorized access to the host environment.

Vulnerability Detail

The vulnerability arises from an authorization bypass in the NodeVM external-module resolver of vm2. When an embedder configures 'require.external' with a custom resolver and 'context: host', the LegacyResolver.customResolve method incorrectly records the resolved module directory without enforcing path boundaries. This flaw allows untrusted guest code to require an allowlisted module and subsequently access a non-allowlisted sibling module, leading to a sandbox escape and potential arbitrary code execution in the host context. The CVSS score for this vulnerability is 9.0, indicating a critical severity level.

How To Fix

Latest published version: 3.12.2 as of 22 Oct 2026

npm install vm2@3.12.2

The newest release already contains this fix.

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

Workaround

As a temporary workaround, avoid using custom resolvers with 'require.external' in the vm2 configuration until you can update to the patched version. This will help mitigate the risk of unauthorized access to the host environment.

Conclusion

The vm2 package has a critical vulnerability that allows for an authorization bypass, potentially leading to sandbox escapes and arbitrary code execution. It is essential to update to version 3.12.2 or later to mitigate this risk. Users are encouraged to utilize tools like Vulert to monitor their applications for vulnerabilities effectively.

See every vulnerability recorded for vm2 →

Share this vulnerability

FAQ

vm2 is a Node.js library that provides a secure sandbox for executing untrusted JavaScript code, allowing developers to run user-generated code safely.

The vulnerability allows untrusted code to bypass authorization checks and access non-allowlisted modules, leading to potential sandbox escapes and arbitrary code execution.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If immediate updates are not possible, avoid using custom resolvers with 'require.external' in your vm2 configuration as a temporary workaround.

The CVSS score of this vulnerability is 9.0, indicating a critical severity level that requires prompt attention.

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

The newest release already contains this fix.

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