CVE-2026-43998

vm2: NodeVM require.root bypass via symlink traversal allows sandbox escape

Published May 13, 2026 CVSS 3.1 · 8.5 High EPSS < 1% KEV · Not listed
Description
vm2 is an open source vm/sandbox for Node.js. In 3.10.5, NodeVM's require.root path restriction can be bypassed using filesystem symlinks, allowing sandboxed code to load modules from outside the allowed root directory in host context. Because path validation uses path.resolve() (which does not dereference symlinks) but module loading uses Node's native require() (which does), an attacker can load arbitrary host-realm modules and achieve remote code execution. This vulnerability is fixed in 3.11.0.

Analysis

AI-generated

Technical impact

vm2’s NodeVM implementation enforces a require.root limit to confine module loading, but the check uses path.resolve() which does not dereference symlinks. A malicious user can therefore create a symlink that points outside the intended root, tricking the Node.js require system into loading host modules. This bypass leads to remote code execution and is formally classified under CWE-59, Path Traversal.

Affected Systems

The vulnerability applies to the open‑source sandbox library vm2 from patriksimek. Versions up to and including 3.10.5 are affected. The fix is bundled in release 3.11.0 and later.

Risk and Exploitability

The CVSS score of 8.5 indicates a high risk, and while the EPSS score is not available, the lack of a KEV listing does not diminish the threat. An attacker executing code inside the sandbox can exploit the symlink bypass to load arbitrary modules from the host environment, effectively achieving remote code execution. The attack requires access to the sandbox’s require.api; no network component is involved, so it is a local privilege escalation within the context of the running process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade vm2 to version 3.11.0 or later, which removes the symlink bypass.
  • If an upgrade is temporarily infeasible, reconfigure NodeVM to use a restrictive require.root that points to an isolated directory and disable or remove any symlinked paths that could be leveraged to escape.
  • Ensure the host filesystem restricts symlink creation from the sandbox or places the sandbox in a directory where symlink permissions are tightly controlled to prevent external module loading.

Generated by OpenCVE AI on May 13, 2026 at 19:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-cp6g-6699-wx9c vm2 has a NodeVM require.root bypass via symlink traversal that allows sandbox escape
History
Type Values Removed Values Added
First Time appeared Vm2 Project
Vm2 Project vm2
CPEs cpe:2.3:a:vm2_project:vm2:3.10.5:*:*:*:*:node.js:*:*
Vendors & Products Vm2 Project
Vm2 Project vm2
Type Values Removed Values Added
First Time appeared Patriksimek
Patriksimek vm2
Vendors & Products Patriksimek
Patriksimek vm2
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description vm2 is an open source vm/sandbox for Node.js. In 3.10.5, NodeVM's require.root path restriction can be bypassed using filesystem symlinks, allowing sandboxed code to load modules from outside the allowed root directory in host context. Because path validation uses path.resolve() (which does not dereference symlinks) but module loading uses Node's native require() (which does), an attacker can load arbitrary host-realm modules and achieve remote code execution. This vulnerability is fixed in 3.11.0.
Title vm2: NodeVM require.root bypass via symlink traversal allows sandbox escape
Weaknesses CWE-59
References
Metrics cvssV3_1

{'score': 8.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses
  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 7, 2026, 12:04 PM
Reserved
May 4, 2026, 8:24 PM
Status
Modified
Published
May 13, 2026, 6:16 PM
Modified
Oct 26, 2026, 5:10 PM