Skip to content
Heist/ feed
CriticalFix available

vm2: GHSA-m283-3h24-438v fix bypass leads to host RCE via call/apply indirection

Type: advisorySource: OSV1 source record

## Summary Untrusted 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. ## PoC Save as `poc.js` and run `node poc.js`: ```js const { VM } = require('vm2'); const vm = new VM({ sandbox: { fetchUser: async () => { const err = new Error('db connection failed'); err.detail = process; // embedder-attached host reference th

Announced Group revision 1
Original source ↗

GHSA-647f-g98j-qq25

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-647f-g98j-qq25

vm2

Source reference: /affected/0/package/name

Affected versions
3.11.6

Source reference: /affected/0/versions

Fixed versions
3.11.7

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "3.11.6"
          },
          {
            "fixed": "3.11.7"
          }
        ]
      }
    ],
    "package": {
      "name": "vm2",
      "purl": "pkg:npm/vm2",
      "ecosystem": "npm"
    },
    "versions": [
      "3.11.6"
    ],
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-647f-g98j-qq25/GHSA-647f-g98j-qq25.json"
    }
  }
]
Related CVEs
CVE-2026-92937

Source reference: /aliases

Publisher severity

critical

Source reference: /database_specific/severity

Event
#61274 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement