{"schema":"threatline.record/2","record":{"id":"CVE-2026-92937","aliases":["GHSA-647f-g98j-qq25"],"summary":"vm2: GHSA-m283-3h24-438v fix bypass leads to host RCE via call/apply indirection","details":"## Summary\n\nUntrusted JavaScript run by vm2 can escape the sandbox and execute arbitrary commands in the host Node.js process when an embedder-exposed host Promise rejects. This is an incomplete fix for GHSA-m283-3h24-438v: the advisory's capability-bearing rejection rebuild runs only through this direct Promise-handler path, so call/apply indirection bypasses the protection it introduced. The bridge sanitises host rejection values before sandbox callbacks run, but the gate at `lib/bridge.js:1624` identity-checks only the direct call target. Registering the rejection handler through `Function.prototype.call` indirection, `p.then.call(p, undefined, cb)`, makes the intercepted target host `Function.prototype.call`, so the sanitiser never runs and the raw host error reaches the sandbox (`lib/bridge.js:1639`) without the rebuild that strips host references carried by its own properties (`lib/setup-sandbox.js:2104`). A rejection error whose own property references a powerful host object, for example `err.detail = process`, therefore reaches sandbox code as a fully functional proxy, and `e.detail.mainModule.require('child_process').execSync(...)` executes with host privileges. The `.apply` form and a stacked `call.call` behave identically.\n\n## PoC\n\nSave as `poc.js` and run `node poc.js`:\n\n```js\nconst { VM } = require('vm2');\nconst vm = new VM({ sandbox: {\n  fetchUser: async () => {\n    const err = new Error('db connection failed');\n    err.detail = process; // embedder-attached host reference\n    throw err;\n  },\n}});\nvm.run(`\n  const p = fetchUser(1);              // proxy of the host Promise\n  p.then.call(p, undefined, (e) => {   // .call indirection skips the sanitiser\n    e.detail.mainModule.require('child_process')\n      .execSync('echo vm2-escape-proof > /tmp/poc.proof');\n  });\n`);\n```\n\n### Observed output\n\n```shell\n$ cat /tmp/poc.proof\nvm2-escape-proof\n```\n\nRegistering the same callback directly, `p.then(undefined, cb)`, strips `detail` and no command runs; the `bind` and `Reflect.apply` forms are sanitised as well, isolating the bypass to `call` and `apply` indirection.\n\n## Impact\n\nAny deployment that evaluates attacker-controlled code with vm2 and exposes a host-realm Promise to the sandbox is affected: an async host function bridged through the `sandbox` option, or a NodeVM external module's async method. If that Promise rejects with an Error carrying a non-primitive own property that references a host object, a diagnostic pattern the vm2 codebase itself documents as routine for Node libraries (`lib/setup-sandbox.js:1877`), a single submission yields arbitrary command execution in the host process with the host account's privileges, including file read and write, process spawning, and network access. In a multi-tenant service evaluating untrusted code, one submission compromises the worker process and every tenant it serves.","categories":["Libraries & packages"],"product":"vm2","vendor":"patriksimek","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-647f-g98j-qq25","source_modified_at":"2026-10-01T15:32:11Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vm2"},"range":"= 3.11.6"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-92937","source_modified_at":"2026-09-18T19:25:51.435Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"vm2","vendor":"patriksimek","versions":[{"lessThan":"3.11.7","status":"affected","version":"3.11.6","versionType":"semver"},{"status":"unaffected","version":"3.11.7","versionType":"semver"}],"defaultStatus":"unaffected"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-647f-g98j-qq25","source_modified_at":"2026-10-01T15:45:06.205871958Z","fetched_at":"2026-10-23T18:48:36.087640Z","package":{"name":"vm2","ecosystem":"npm","purl":"pkg:npm/vm2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.11.6"},{"fixed":"3.11.7"}]}],"versions":["3.11.6"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-647f-g98j-qq25","source_modified_at":"2026-10-01T15:32:11Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vm2"},"version":"3.11.7"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-92937","source_modified_at":"2026-09-18T19:25:51.435Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vm2","ecosystem":null},"version":"3.11.7","basis":"first unaffected version stated in the CVE record"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-647f-g98j-qq25","source_modified_at":"2026-10-01T15:45:06.205871958Z","fetched_at":"2026-10-23T18:48:36.087640Z","package":{"name":"vm2","ecosystem":"npm","purl":"pkg:npm/vm2"},"version":"3.11.7"}],"cvss":10,"severity":"Critical","kev":{"listed":false},"epss":{"probability":0.01033,"percentile":0.63539,"score_date":"2026-10-23"},"published_at":"2026-09-17T13:46:02.195Z","modified_at":"2026-10-01T15:45:06.205871958Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-647f-g98j-qq25","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-01T15:32:11Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-92937","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-18T19:25:51.435Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-647f-g98j-qq25","fetched_at":"2026-10-23T18:48:36.087640Z","source_modified_at":"2026-10-01T15:45:06.205871958Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-92937","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/patriksimek/vm2/security/advisories/GHSA-647f-g98j-qq25","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-92937","source":"GitHub Advisory Database"},{"url":"https://github.com/patriksimek/vm2/commit/315786904c416be68ff2517b86fb9d71fa6761db","source":"GitHub Advisory Database"},{"url":"https://github.com/patriksimek/vm2/releases/tag/v3.11.7","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://www.vulncheck.com/advisories/vm2-3.11.6-remote-code-execution-via-promise-call-apply","tags":["third-party-advisory"]},{"url":"https://github.com/advisories/GHSA-647f-g98j-qq25","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"yes","technical_impact":"total","assessed_at":"2026-09-18T19:25:43.226436Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-01T15:45:06.205871958Z","content_hash":"108e1b2e48aef5e2b83da25f71acc9c0543d47ae1ca0748a05d4bdaf5ef3ffdc"}}
