GHSA-RP36-8XQ3-R6C4

Vulnerability from github – Published: 2026-05-29 17:59 – Updated: 2026-06-12 20:56
VLAI
Summary
NodeVM builtin denylist bypass via process and inspector/promises allows host code execution
Details

Summary

NodeVM blocks several dangerous Node.js builtins such as module, worker_threads, cluster, vm, repl, and inspector.

However, the denylist misses process and inspector/promises. Both can be used from sandboxed code to reach host-side execution primitives.

This allows sandboxed code to bypass the intended builtin restrictions and execute code in the host process.

Details

The dangerous builtin denylist is defined in lib/builtin.js. This list does not include:

process
inspector/promises

Non-denied builtins are exposed to the sandbox through:

builtins.set(key, special ? special : vm => vm.readonly(hostRequire(key)));

Because of this, sandboxed code can bypass the expected restrictions in two ways:

  1. require('process').getBuiltinModule('child_process') reloads child_process, even when child_process is excluded.
  2. require('inspector/promises') exposes the Inspector protocol and can call Runtime.evaluate in the host process.

PoC

Tested on:

vm2: 3.11.2
Node.js: v25.9.0

Run from the vm2 repository root:

node poc/dangerous-builtin-denylist-rce.js

dangerous-builtin-denylist-rce.js

The PoC first confirms the intended restrictions work:

require("inspector"): BLOCKED
require("child_process"): BLOCKED

Then it bypasses them:

require("process").getBuiltinModule("child_process").execFileSync(...)

This spawns a host child process. It also confirms:

require("inspector/promises").Session().post("Runtime.evaluate", ...)

This evaluates JavaScript in the host process.

Screenshot 2026-05-10 at 11 53 33 AM

Impact

An attacker who can run untrusted JavaScript inside NodeVM with affected builtin settings can escape the sandbox and execute arbitrary code in the host process.

This can lead to full compromise of the application process, including reading files, writing files, spawning processes, and accessing host environment secrets.

(This is not reachable with the default NodeVM configuration where require is disabled or no affected builtins are allowed. It affects applications that allow process, inspector/promises, or the wildcard "*" in require.builtin.)

Suggested fix

Add process and inspector/promises to the dangerous builtin blocklist.

Also consider blocking dangerous builtin families by prefix, for example blocking both:

inspector
inspector/*

instead of only exact module names.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 3.11.3"
      },
      "package": {
        "ecosystem": "npm",
        "name": "vm2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.11.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-47140"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-693"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-29T17:59:23Z",
    "nvd_published_at": "2026-06-12T15:16:28Z",
    "severity": "CRITICAL"
  },
  "details": "## Summary\n\n`NodeVM` blocks several dangerous Node.js builtins such as `module`, `worker_threads`, `cluster`, `vm`, `repl`, and `inspector`.\n\nHowever, the denylist misses `process` and `inspector/promises`. Both can be used from sandboxed code to reach host-side execution primitives.\n\nThis allows sandboxed code to bypass the intended builtin restrictions and execute code in the host process.\n\n## Details\n\nThe dangerous builtin denylist is defined in `lib/builtin.js`. This list does not include:\n\n```text\nprocess\ninspector/promises\n```\n\nNon-denied builtins are exposed to the sandbox through:\n\n```js\nbuiltins.set(key, special ? special : vm =\u003e vm.readonly(hostRequire(key)));\n```\n\nBecause of this, sandboxed code can bypass the expected restrictions in two ways:\n\n1. `require(\u0027process\u0027).getBuiltinModule(\u0027child_process\u0027)` reloads `child_process`, even when `child_process` is excluded.\n2. `require(\u0027inspector/promises\u0027)` exposes the Inspector protocol and can call `Runtime.evaluate` in the host process.\n\n## PoC\n\nTested on:\n\n```text\nvm2: 3.11.2\nNode.js: v25.9.0\n```\n\nRun from the vm2 repository root:\n\n```bash\nnode poc/dangerous-builtin-denylist-rce.js\n```\n[dangerous-builtin-denylist-rce.js](https://github.com/user-attachments/files/27570113/dangerous-builtin-denylist-rce.js)\n\n\nThe PoC first confirms the intended restrictions work:\n\n```text\nrequire(\"inspector\"): BLOCKED\nrequire(\"child_process\"): BLOCKED\n```\n\nThen it bypasses them:\n\n```text\nrequire(\"process\").getBuiltinModule(\"child_process\").execFileSync(...)\n```\n\nThis spawns a host child process. It also confirms:\n\n```text\nrequire(\"inspector/promises\").Session().post(\"Runtime.evaluate\", ...)\n```\n\nThis evaluates JavaScript in the host process.\n\n\u003cimg width=\"858\" height=\"766\" alt=\"Screenshot 2026-05-10 at 11 53 33\u202fAM\" src=\"https://github.com/user-attachments/assets/7614aecb-5ffd-4c41-bfe8-e1fcb3b1bb59\" /\u003e\n\n## Impact\n\nAn attacker who can run untrusted JavaScript inside `NodeVM` with affected builtin settings can escape the sandbox and execute arbitrary code in the host process.\n\nThis can lead to full compromise of the application process, including reading files, writing files, spawning processes, and accessing host environment secrets.\n\n(This is not reachable with the default NodeVM configuration where require is disabled or no affected builtins are allowed. It affects applications that allow process, inspector/promises, or the wildcard \"*\" in require.builtin.)\n\n## Suggested fix\n\nAdd `process` and `inspector/promises` to the dangerous builtin blocklist.\n\nAlso consider blocking dangerous builtin families by prefix, for example blocking both:\n\n```text\ninspector\ninspector/*\n```\n\ninstead of only exact module names.",
  "id": "GHSA-rp36-8xq3-r6c4",
  "modified": "2026-06-12T20:56:50Z",
  "published": "2026-05-29T17:59:23Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-rp36-8xq3-r6c4"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-47140"
    },
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/commit/a1ed47a98d1cc36cb48c0d566d55889688e0b59b"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/patriksimek/vm2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/releases/tag/v3.11.4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "NodeVM builtin denylist bypass via process and inspector/promises allows host code execution"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…