Skip to content
Heist/ feed
CriticalFix available

vm2 crypto builtin loads attacker native code through setEngine

Type: advisorySource: OSV1 source record

Summary vm2 3.11.6 exposes the host `crypto` module to a `NodeVM` when that single builtin is allowed. The module is presented through a read-only bridge, but its functions still execute with host-process authority. `crypto.setEngine()` accepts a filesystem path and asks OpenSSL to dynamically load the referenced native library. An attacker whose untrusted plugin package contains a native library can therefore load that library into the host process by calling `crypto.setEngine()` from sandboxed JavaScript. The native library's constructor executes before OpenSSL finishes validating whether the file is a usable engine. Consequently, even the expected `ERR_CRYPTO_ENGINE_UNKNOWN` exception occurs only after arbitrary native code has already run. The exploit requires only the `crypto` builtin. It does not require `fs`, `process`, `module`, `child_process`, `worker_threads`, `vm`, `inspector`, unrestricted builtins, or vm2 nesting. ### Details The vulnerable boundary is the generic builtin loader. Builtins that are not specially wrapped or classified as dangerous are imported in the host realm and exposed through a recursive read-only proxy: ```js builtins.set(key, special ? special : vm => vm.readonly(hostRequire(key))); ``` Read-only prevents sandbox code from assigning properties on the module object. It does not reduce the authority of callable exports. Calls are forwarded to the original host function with bridge values converted back to host values. The `crypto` module incl

Announced Group revision 1
Original source ↗

GHSA-46pr-c5wc-xffx

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-46pr-c5wc-xffx

vm2

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
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.3"
          },
          {
            "fixed": "3.11.7"
          }
        ]
      }
    ],
    "package": {
      "name": "vm2",
      "purl": "pkg:npm/vm2",
      "ecosystem": "npm"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-46pr-c5wc-xffx/GHSA-46pr-c5wc-xffx.json",
      "last_known_affected_version_range": "<= 3.11.6"
    }
  }
]
Related CVEs
CVE-2026-92939

Source reference: /aliases

Publisher severity

critical

Source reference: /database_specific/severity

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