CVE-2026-93604: vm2 3.11.8 Sandbox Escape via crypto.setFips
vm2 through 3.12.0 exposes Node.js's crypto.setFips() function to untrusted guest code when an embedder explicitly allowlists the crypto builtin for a NodeVM (require.builtin: ['crypto']). The builtin sanitizer (sanitizeCryptoModule in lib/builtin.js) replaces crypto.setEngine but leaves crypto.setFips callable, and the readonly wrapper used to expose the host module does not localize side effects of forwarded host functions. Guest code can therefore call crypto.setFips() to change the FIPS mode of the entire host process; the modified mode is subsequently observed by trusted host code (crypto.getFips() changed from 0 to 1 in the reported test), crossing the NodeVM isolation boundary. Fixed in vm2 3.12.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
vm2to a version that resolves this vulnerability.Fixed in 3.12.1 - Configuration
Do not embed 'crypto' in the NodeVM allowlist (i.e., remove crypto from require.builtin); the vulnerability occurs when untrusted guest code can call crypto.setFips() via allowlisted crypto.
vm2 NodeVM require.builtin allowlist require.builtin = ['crypto'] (do not allowlist 'crypto')
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Only NodeVM deployments that explicitly allowlist the Node.js crypto builtin with require.builtin: ['crypto'] expose crypto.setFips() to untrusted guest code. The issue affects vm2 through version 3.12.0.
What does an attacker need to exploit it?
An attacker needs the ability to run untrusted code inside an affected NodeVM where the crypto builtin has been allowlisted. No privileges or user interaction are required.
What is the impact on the host process?
Guest code can invoke crypto.setFips() and alter the FIPS mode for the entire host process. Trusted host code subsequently observes the changed mode through crypto.getFips(), so the effect crosses the NodeVM isolation boundary.
What can be done if updating is not immediately possible?
Remove crypto from the NodeVM require.builtin allowlist so guest code cannot access the affected builtin. The issue is fixed in vm2 3.12.1.