Junglewise Threat Intelligence

CVE-2026-47137: patriksimek vm2 sandbox escape via configuration bypass

CVE-2026-47137 · Severity: critical · CVSS 10 · Published 2026-06-12

Technologies: vm2 (npm). Vendors: npm.

Executive brief

vm2 is a popular tool used to safely run untrusted code in Node.js environments. A flaw in how it handles security settings allows an attacker to bypass intended restrictions and escape the secure "sandbox." If exploited, this allows the attacker to run unauthorized commands on the underlying server, potentially leading to full system takeover or data theft.

Technical details

A sandbox escape vulnerability exists in vm2 due to an incomplete fix for a previous security issue. The validation logic in nodevm.js used a strict equality check (options.require === false) to block insecure configurations. However, an attacker can bypass this check by omitting the 'require' option entirely, causing it to be 'undefined' during the check but later defaulting to 'false' during destructuring. This results in a configuration that allows the sandbox to access the 'vm2' module itself, which can be used as a primitive to escape the sandbox and execute arbitrary code on the host system via child_process. The issue is patched in version 3.11.4.

Affected products

  • patriksimek vm2 < 3.11.4

Timeline

  • 2026-05-17: patched: Initial fix for the bypass committed.
  • 2026-06-12: advisory: CVE-2026-47137 published.

References

Related threats