Arbitrary Code Injection Affecting vm2 package, versions >=3.11.0 <3.11.2


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-VM2-16624526
  • published10 May 2026
  • disclosed8 May 2026
  • creditXmiliaH

Introduced: 8 May 2026

NewCVE-2026-44009  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade vm2 to version 3.11.2 or higher.

Overview

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules.

Affected versions of this package are vulnerable to Arbitrary Code Injection via the handleException function and the sandbox-side globalPromise.prototype.then wrapper in lib/setup-sandbox.js. An attacker can reach host Function and execute arbitrary code by throwing or resolving a sandbox-realm null-prototype object and then assigning a host function such as Buffer.prototype.inspect to a property on the caught/resolved value. The bridge proxy created for that value writes the raw host function back onto the underlying sandbox object, so the original sandbox reference exposes a host function whose .constructor leads to Function('return process')() and full sandbox escape.

Notes: This issue was introduced as part of the mitigation for CVE-2026-44000

CVSS Base Scores

version 4.0
version 3.1