Critical Vulnerability in vm2 Package: Arbitrary Native Code Execution via Crypto Built-in

vm2 Updated 01 Oct 2026

Summary

17/09/2026
CRITICAL
No i
Critical
9.9

GHSA-6jgm-4w45-vh8j: Duplicate Advisory: vm2 crypto builtin loads attacker native code through setEngine. Affects vm2 versions >= 3.11.3, <= 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

The vm2 package is a popular Node.js library that provides a sandboxed environment for executing untrusted JavaScript code. It allows developers to run code securely without exposing the host environment. However, versions 3.11.3 to 3.11.6 have a critical vulnerability that exposes the host Node.js crypto module, allowing attackers to execute arbitrary native code within the host process.

Vulnerability Detail

The vulnerability arises from the exposure of the Node.js crypto module to a NodeVM sandbox when the crypto built-in is allowed. Although the module is presented via a read-only proxy, its callable exports execute with host-process authority. This means that sandboxed JavaScript can invoke crypto.setEngine() with a path to an attacker-controlled native library. When OpenSSL attempts to load this library, it executes native code in the host process before validating the engine symbol, leading to a sandbox escape and arbitrary code execution. This vulnerability is critical, with a CVSS score of 9.9, and does not require access to other Node.js modules like fs or process.

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 the crypto built-in in the vm2 sandbox until you can update to the patched version. Additionally, review your code to ensure that untrusted code does not have access to sensitive modules.

Conclusion

The vm2 package has a critical vulnerability that exposes the host Node.js crypto module, allowing for arbitrary native code execution. It is essential to update to version 3.11.7 or later to mitigate this risk. Users should also consider using tools like Vulert to monitor for vulnerabilities in their applications.

See every vulnerability recorded for vm2 →

Share this vulnerability

FAQ

Versions 3.11.3 to 3.11.6 of the vm2 package are affected.

The vulnerability allows attackers to execute arbitrary native code in the host process, leading to a potential compromise of the entire application.

You can use Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Yes, you can temporarily avoid using the crypto built-in in the vm2 sandbox until you can update to a safe version.

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

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