Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. vm2
  4. ›
  5. CVE-2026-92946

CVE-2026-92946: vm2: NodeVM `require.external` without an explicit `require.root` grants unrestricted host filesystem access and full RCE

October 5, 2026

NodeVM’s require.external option lets sandboxed code require() local files and npm packages. When require.external is enabled and require.root is not explicitly set to a path that excludes node_modules, two defaults combine to fully defeat the sandbox:

  • require.root defaults to unrestricted — “if omitted every path is allowed.”
  • require.context defaults to "host" — files loaded this way run through the real Node.js require(), not inside any vm2 sandbox.

Sandboxed code can therefore require() a relative or absolute path to vm2’s own installed package (node_modules/vm2), obtain the real, unwrapped NodeVM/VM classes, construct a brand-new unrestricted nested NodeVM instance, and execute arbitrary host OS commands via child_process.

This is exploitable using vm2’s own documented “Quick Examples” configuration in README.md:

const vm = new NodeVM({
require: {
external: true,
root: './',
},
});

root: './' reads as a safety restriction but, in any ordinary npm project layout, ./node_modules/vm2 sits inside that same directory tree — so the restriction does not exclude vm2 itself. An application built by following the README’s quick-start guide is affected by default.

References

  • github.com/advisories/GHSA-j3hm-6rg5-mchv
  • github.com/patriksimek/vm2/commit/903017c8a1eae9aba947ec854468b48155e79f86
  • github.com/patriksimek/vm2/releases/tag/v3.11.7
  • github.com/patriksimek/vm2/security/advisories/GHSA-j3hm-6rg5-mchv
  • nvd.nist.gov/vuln/detail/CVE-2026-92946
  • www.vulncheck.com/advisories/vm2-before-3.11.7-remote-code-execution-via-require-external

Code Behaviors & Features

Detect and mitigate CVE-2026-92946 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.11.7

Fixed versions

  • 3.11.7

Solution

Upgrade to version 3.11.7 or above.

Impact 10 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-913: Improper Control of Dynamically-Managed Code Resources

Source file

npm/vm2/CVE-2026-92946.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:22 +0000.