Skip to content
Heist/ feed
CriticalFix available

vm2 Custom Module Resolver Can Bypass the External Package Allowlist by Loading a Colliding Host Package

Type: advisorySource: OSV1 source record

### Summary vm2 is a sandbox library for isolating and executing untrusted JavaScript code inside a Node.js process. It can restrict access to built-in modules and external packages. When `NodeVM` enables an `external` allowlist together with a custom `resolve` callback, vm2 checks the requested package name with a non-exact match. For example, if the allowlist only permits `left-pad`, an attacker can still bypass the check with a colliding package name such as `evil-left-pad`, because it contains the allowlisted name. If the colliding package already exists in a host path resolvable by the custom resolver, or if the target application's custom resolver / dependency-management workflow downloads the package and places it in a resolvable path, vm2 loads and executes that package in the host context. This lets sandboxed code bypass the module allowlist and may further lead to host code execution. ### Details `NodeVM` supports `require.external` to configure which external npm packages sandboxed code may load. It also supports a custom resolver through `require.resolve`. This combination is commonly used in business plugin systems, user-script platforms, or sandbox execution environments: the application allows only a small set of trusted dependencies while using a custom resolver that points to the application's own package directory. The vulnerability is in the allowlist pre-check logic before the custom resolver is called. vm2 generates a regular expression from the `external

Announced Group revision 1
Original source ↗

GHSA-c48m-32m9-vx93

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-c48m-32m9-vx93

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": "0"
          },
          {
            "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-c48m-32m9-vx93/GHSA-c48m-32m9-vx93.json",
      "last_known_affected_version_range": "<= 3.11.6"
    }
  }
]
Related CVEs
CVE-2026-92951

Source reference: /aliases

Publisher severity

critical

Source reference: /database_specific/severity

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