CVE-2026-92936: vm2 Package Exposes Host Filesystem Paths via Error Stack Formatting

vm2 Updated 06 Oct 2026

Summary

05/10/2026
Yes i
Moderate
5.8

CVE-2026-92936: vm2 leaks absolute host filesystem paths to sandbox code via error stack formatting. Affects vm2 versions >= 3.11.0, < 3.11.7. Fixed in 3.11.7. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The vm2 package is a popular Node.js library that provides a sandboxed environment for executing untrusted code securely. It allows developers to run JavaScript code in a controlled manner, preventing access to the host environment. However, a recent vulnerability has been identified that compromises this security by leaking sensitive filesystem paths.

Vulnerability Detail

The vulnerability arises from the way vm2 handles syntax errors in the sandboxed code. When attacker-controlled code triggers a syntax error, the error stack is returned to the sandbox without proper redaction of sensitive information. This allows the attacker to read absolute paths from the host filesystem, including paths to Node.js internals and the embedding application. The issue affects default configurations of both VM and NodeVM, making it a significant risk for applications using these settings.

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

This is the first release that contains the fix.

npm install vm2@3.11.7

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

Workaround

As a temporary workaround, consider modifying the code to handle errors more securely. For example, avoid exposing the error stack directly to the sandbox. Instead, you can catch errors and return a sanitized message without sensitive information:

const { VM } = require('vm2');
const vm = new VM();

try {
  vm.run(`
    var s; try { eval("@@@ catch") } catch (e) { s = 'An error occurred'; }
    s;
  `);
} catch (error) {
  console.error('Error running VM:', error);
}

Conclusion

The vm2 package has a vulnerability that allows sensitive filesystem paths to be exposed through error stack formatting. It is crucial to update to the patched version (3.11.7 or later) to protect your application from potential attacks. Implementing secure error handling can also help mitigate risks in the meantime.

See every vulnerability recorded for vm2 →

Share this vulnerability

FAQ

The vulnerability allows attacker-controlled code to read sensitive filesystem paths from the host environment through error stack formatting.

Versions of vm2 from 3.11.0 to 3.11.6 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without requiring any signup.

The CVSS score of this vulnerability is 5.8, indicating a moderate severity level.

While updating is the best solution, you can implement error handling to avoid exposing sensitive information as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for vm2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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

This is the first release that contains the fix.

npm install vm2@3.11.7

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