vm2 information disclosure via error stack formatting

Severity: medium · CVSS 5.8 · Published 2026-09-17

vm2 is a JavaScript sandbox that isolates untrusted code execution. Attacker code can trigger a syntax error and read the stack trace, which leaks absolute filesystem paths from the host system, the embedding application's source tree, and internal Node.js paths. This information disclosure helps attackers fingerprint deployment infrastructure and plan further attacks, though it does not enable code execution on the host.

Technologies: vm2 (npm), Patriksimek Vm2. Vendors: npm, Patriksimek.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 5.8, published 17 September 2026.
Which products and versions are affected?
vm2 (npm) >= 3.11.0, <= 3.11.6; Patriksimek Vm2 3.11.0 through 3.11.6.
Is there a fix for This vulnerability?
Yes: fixed in vm2 3.11.7. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run vm2 (npm) or Patriksimek Vm2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: vm2 3.11.7

Technical details

The vulnerability exists in vm2's error stack formatting bridge (lib/bridge.js): when sandboxed code calls eval() with malformed source, the host-side source transformer throws a SyntaxError before the sandbox-side stack redaction runs. Sandboxed code can read the .stack property of caught errors, and the bridge forwards this read to the host-realm formatter, which returns the unredacted stack string containing absolute paths and function names. The vulnerability affects default VM() and NodeVM() configurations without special options, and persists even when string eval is disabled.

Affected products

  • Patriksimek vm2 3.11.0 through 3.11.6

Timeline

  • 2026-08-24: disclosed: Original advisory GHSA-x6m4-chr9-cg97 published
  • 2026-08-24: patched: Fix released in 3.11.7

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.