Improper Control of Dynamically-Managed Code Resources Affecting vm2 package, versions <3.12.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.73% (53rd percentile)

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 IDSNYK-JS-VM2-20044275
  • published22 Sept 2026
  • disclosed18 Sept 2026
  • creditRaj Chowdhury

Introduced: 18 Sep 2026

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

How to fix?

Upgrade vm2 to version 3.12.1 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 Improper Control of Dynamically-Managed Code Resources via a sloppy-mode host function invoked from the sandbox with a nullish receiver. When sandbox code calls an embedder-exposed sloppy-mode host function without a receiver, V8's OrdinaryCallBindThis substitutes the host realm's global object for the function's this. The bridge in lib/bridge.js previously wrapped and delivered that global object into the sandbox like any other host value, allowing an attacker to reach host globals and call process.getBuiltinModule('child_process') or equivalent APIs for full remote code execution. The fix adds an identity check at the three host-to-sandbox coercion chokepoints (thisFromOtherWithFactory, thisEnsureThis, thisFromOtherForThrow) to refuse delivery of the host global, returning undefined instead.

Note: This is only exploitable if the embedding application exposes at least one non-strict (sloppy-mode) host function to the sandbox; strict-mode and ES module host functions are not affected.

CVSS Base Scores

version 4.0
version 3.1