/

CVE-2026-93604

Severity:

HIGH RISK

(7.2)

Sandbox Escape (CWE-284) in vm2 Node.js Crypto Module

CVE-2026-93604

Deferred

Vulnerability type

Category:

Sandbox Escape

CWE:

CWE-284

Impact:

Host Process Security-State Manipulation

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A sandbox isolation weakness in vm2 through 3.12.0 exposes Node.js's crypto.setFips() function to guest code when an embedder explicitly allowlists the crypto builtin. Guest code may change the FIPS mode of the entire host process, allowing trusted host code to observe a security-sensitive state change outside the intended NodeVM boundary.

Affected context

The issue occurs in vm2 deployments that expose the Node.js crypto builtin to untrusted NodeVM guest code through an explicit allowlist. It is relevant when the builtin sanitizer and readonly wrapper forward host functions without isolating their process-wide side effects. Deployments that do not expose crypto to guest code, or that otherwise prevent access to the affected function, may not be exposed to this specific condition.

Exploit preconditions

  • Attack surface: NodeVM guest-code execution with access to an allowlisted Node.js builtin
  • Required access: Ability to execute code within the affected vm2 guest context
  • Trigger point: Invocation of the exposed crypto.setFips() function
  • Why exploitation is possible: The sanitizer removes some sensitive functionality but leaves setFips() callable, while the readonly wrapper forwards the function's side effect to the host process rather than localizing it within the sandbox

Why this happens

The underlying bug is an incomplete capability-restriction boundary in the builtin sanitizer. Although one sensitive crypto function is replaced, crypto.setFips() remains available through the host module wrapper. Because this function changes process-wide cryptographic state, forwarding it without a sandbox-local implementation allows guest-controlled state changes to affect trusted host code. This behavior maps to CWE-284: Improper Access Control, because the sandbox fails to restrict access to a security-sensitive host capability.

Potential impact

  • Guest code may change the FIPS mode observed by trusted host code.
  • Applications may make cryptographic decisions using an attacker-influenced process state.
  • Host security-policy assumptions may be weakened or invalidated.
  • Shared-process workloads may experience integrity or availability impacts.
  • The isolation boundary between guest and trusted code could be bypassed for other process-wide side effects exposed through similar wrappers.

General mitigation guidance

Mitigation generally focuses on reducing guest access to host capabilities and ensuring that forwarded functions cannot alter process-wide state.

Common defensive patterns include:

  • Avoiding exposure of the crypto builtin to untrusted NodeVM code unless it is strictly required.
  • Using narrowly scoped, capability-based interfaces instead of forwarding complete host modules.
  • Replacing process-global APIs with sandbox-local or policy-controlled abstractions.
  • Maintaining explicit deny-lists for functions that change runtime, cryptographic, environmental, or process-wide state.
  • Isolating untrusted workloads in separate processes or containers when strong boundaries are required.
  • Running guest workloads with least privilege and limiting access to sensitive host resources.

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules that identify allowlisting of crypto or other host builtins for untrusted execution contexts.
  • Code review checks for wrappers that forward host functions without modeling global or process-wide side effects.
  • Tests that compare security-sensitive host state before and after execution of guest code.
  • Policy enforcement that blocks exposure of process-global configuration APIs to sandboxed workloads.
  • Dependency and configuration reviews that verify sandbox boundary controls and approved builtin lists.

Automated code-review and software-composition tools may help identify risky builtin exposure, but behavioral tests are also important because the problem depends on side effects across the isolation boundary.

Sources

SourceLink
github.comgithub.com/patriksimek/vm2/security/advisories/GHSA-x3v6-43hc-82mc
vulncheck.comvulncheck.com/advisories/vm2-3.11.8-sandbox-escape-via-crypto-setfips

Frequently asked

questions

The issue is not inherently a network-level vulnerability. Exploitation generally requires an attacker to execute untrusted code in a NodeVM whose embedder has exposed the affected crypto builtin.

Direct host-process access is not required once guest code is running with the relevant builtin capability. The guest's ability to invoke the exposed function is the key prerequisite.

Prevent untrusted guest code from receiving the crypto builtin or any process-global API that is not strictly necessary. Where functionality is required, expose a narrowly scoped interface that cannot modify host-wide state.

Treat every forwarded host function as a capability requiring side-effect analysis, maintain explicit allowlists for safe interfaces, test isolation boundaries for global-state changes, and use separate processes for workloads requiring stronger containment.

Find out what's already
exploitable in your codebase.