← Terug naar overzicht

GitLab's Threat Research Group discovered a critical sandbox escape vulnerability (CVSS 3.1: 10.0) in vm2, a widely used Node.js sandboxing library with ~1.25 million weekly npm downloads. The flaw allows remote code execution when using the default configuration from vm2's own README, specifically when require.external is enabled with root set to './'. The attack works by requiring vm2's own package from within the sandbox, which loads through Node's real unsandboxed require() due to the default context: 'host' setting, then spinning up a second unrestricted NodeVM with access to child_process. The vulnerability was fixed in vm2 version 3.11.7, but the fix is narrow and broader configuration risks remain. Users relying on require.external with overly broad require.root settings remain vulnerable even after patching. GitLab recommends restricting require.root strictly, setting context: 'sandbox', and for truly untrusted code isolation, using containers or separate processes instead of vm2.

Affected products

  • Node.js
  • vm2

Categories

  • Supply Chain & Dependencies
  • Web Technologies
  • Zero-Day Vulnerabilities