CVE-2026-92958: vm2 Denylist Bypass Vulnerability Allowing Host Filesystem Writes
Summary
CVE-2026-92958: vm2: NodeVM builtin denylist bypass via fs/promises despite -fs, allowing host filesystem writes. Affects vm2 versions < 3.11.7. Fixed in 3.11.7. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
vm2 is a popular Node.js package that provides a sandboxed environment for executing untrusted code securely. It allows developers to run JavaScript code in a controlled manner, isolating it from the host environment to prevent unauthorized access to system resources. However, a recent vulnerability has been identified that compromises this isolation, enabling sandboxed code to access the host filesystem despite explicit denials.
Vulnerability Detail
The vulnerability arises from a flaw in the NodeVM's builtin wildcard policy, which allows sandboxed code to access 'fs/promises' even when 'fs' is denied. This occurs because negative entries in the builtin configuration are checked by exact name, meaning that while 'fs' is blocked, 'fs/promises' remains accessible. This oversight can lead to unauthorized file creation and modification on the host filesystem, posing significant security risks.
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, you can modify your NodeVM configuration to explicitly deny 'fs/promises' by adding '-fs/promises' to the builtin denylist. Here is an example configuration:
const { NodeVM } = require('vm2');
const vm = new NodeVM({ require: { builtin: ['*', '-fs', '-child_process', '-fs/promises'] } });
Conclusion
The vm2 package has a critical vulnerability that allows sandboxed code to bypass filesystem access restrictions. It is essential to update to the patched version to secure your application. Implementing the suggested workaround can provide temporary relief until the update is applied.
See every vulnerability recorded for vm2 →
FAQ
The CVSS score for this vulnerability is 8.5, indicating a high severity level.
If your application uses vm2 with the affected configuration, it may allow untrusted code to write files to your host filesystem, leading to potential data loss or unauthorized access.
Yes, you can use Vulert to monitor and alert for open-source vulnerabilities in your software. By analyzing your package-lock.json, Vulert provides real-time alerts for vulnerabilities.
If immediate updates are not feasible, implement the suggested workaround to deny access to 'fs/promises' in your NodeVM configuration.
You can find detailed information about this vulnerability in the official GitHub advisory or by visiting the Vulert website.
References
Related vulnerabilities
Recent vulnerabilities recorded for vm2.