GHSA-R9PM-GXMW-WV6P

Vulnerability from github – Published: 2026-05-29 18:08 – Updated: 2026-06-12 19:30
VLAI
Summary
NodeVM network builtin exclusions bypass via internal _http_client and _http_server
Details

Summary

NodeVM supports excluding public network builtins from the wildcard builtin option. With this configuration direct access to http, https, http2, net, dgram, tls, dns, and dns/promises is blocked.

However, Node.js also exposes underscored internal HTTP builtins such as _http_client and _http_server. These are not blocked when the public modules are excluded.

Sandboxed code can use these internal builtins to make outbound HTTP requests and open listening HTTP sockets even though the public network modules are denied.

Note: This is not host RCE. It is a network capability bypass that can lead to SSRF-style access to internal services.

Details

The wildcard builtin expansion is based on Node.js builtin module names:

const BUILTIN_MODULES = (nmod.builtinModules || Object.getOwnPropertyNames(process.binding('natives')))
  .filter(s=>!s.startsWith('internal/') && !DANGEROUS_BUILTINS.has(s));

Public modules can be excluded with -name:

if (builtins.indexOf(`-${name}`) === -1) {
  addDefaultBuiltin(res, name, hostRequire);
}

But excluding http and net does not exclude internal siblings such as:

_http_client
_http_server
_tls_wrap

These internal modules expose network primitives.

Confirmed examples:

  1. require('_http_client').ClientRequest(...) performs an outbound HTTP request to a host-local service while http and net are blocked.
  2. require('_http_server').Server(...).listen(...) opens a listening HTTP socket while http and net are blocked.

PoC

Tested on:

vm2: 3.11.2
Node.js: v25.9.0

Run from the vm2 repository root:

node poc/internal-http-builtin-network-bypass.js

internal-http-builtin-network-bypass.js

The PoC first confirms the intended restrictions work then bypasses them:

require("_http_client").ClientRequest(...)

This performs an HTTP request to a host-local service and reads the response.

It also confirms:

require("_http_server").Server(...).listen(0)

This opens a listening HTTP socket from inside the sandbox.

Screenshot 2026-05-10 at 1 07 39 PM

Impact

An attacker who can run untrusted JavaScript inside NodeVM with this affected builtin configuration can regain network access even when the application attempted to block network modules.

This can allow SSRF-style access to localhost services, metadata endpoints, internal admin panels, or other network resources reachable from the host process.

Suggested fix

Treat underscored internal network modules as dangerous or link their availability to the public module they wrap.

At minimum, exclude related internal modules such as:

_http_agent
_http_client
_http_common
_http_incoming
_http_outgoing
_http_server
_tls_common
_tls_wrap

Alternatively, deny underscored Node.js internals from wildcard builtin expansion by default.

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-47139"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-693"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-29T18:08:06Z",
    "nvd_published_at": "2026-06-12T15:16:28Z",
    "severity": "HIGH"
  },
  "details": "## Summary\n\n`NodeVM` supports excluding public network builtins from the wildcard builtin option. With this configuration direct access to `http`, `https`, `http2`, `net`, `dgram`, `tls`, `dns`, and `dns/promises` is blocked.\n\nHowever, Node.js also exposes underscored internal HTTP builtins such as `_http_client` and `_http_server`. These are not blocked when the public modules are excluded.\n\nSandboxed code can use these internal builtins to make outbound HTTP requests and open listening HTTP sockets even though the public network modules are denied.\n\n**Note**: This is not host RCE. It is a network capability bypass that can lead to SSRF-style access to internal services.\n\n## Details\n\nThe wildcard builtin expansion is based on Node.js builtin module names:\n\n```js\nconst BUILTIN_MODULES = (nmod.builtinModules || Object.getOwnPropertyNames(process.binding(\u0027natives\u0027)))\n  .filter(s=\u003e!s.startsWith(\u0027internal/\u0027) \u0026\u0026 !DANGEROUS_BUILTINS.has(s));\n```\n\nPublic modules can be excluded with `-name`:\n\n```js\nif (builtins.indexOf(`-${name}`) === -1) {\n  addDefaultBuiltin(res, name, hostRequire);\n}\n```\n\nBut excluding `http` and `net` does not exclude internal siblings such as:\n\n```text\n_http_client\n_http_server\n_tls_wrap\n```\n\nThese internal modules expose network primitives.\n\nConfirmed examples:\n\n1. `require(\u0027_http_client\u0027).ClientRequest(...)` performs an outbound HTTP request to a host-local service while `http` and `net` are blocked.\n2. `require(\u0027_http_server\u0027).Server(...).listen(...)` opens a listening HTTP socket while `http` and `net` are blocked.\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/internal-http-builtin-network-bypass.js\n```\n[internal-http-builtin-network-bypass.js](https://github.com/user-attachments/files/27571182/internal-http-builtin-network-bypass.js)\n\n\nThe PoC first confirms the intended restrictions work then bypasses them:\n\n```text\nrequire(\"_http_client\").ClientRequest(...)\n```\n\nThis performs an HTTP request to a host-local service and reads the response.\n\nIt also confirms:\n\n```text\nrequire(\"_http_server\").Server(...).listen(0)\n```\n\nThis opens a listening HTTP socket from inside the sandbox.\n\n\u003cimg width=\"951\" height=\"623\" alt=\"Screenshot 2026-05-10 at 1 07 39\u202fPM\" src=\"https://github.com/user-attachments/assets/21bfb1ff-dd15-423a-92c4-0337cd07816c\" /\u003e\n\n## Impact\n\nAn attacker who can run untrusted JavaScript inside `NodeVM` with this affected builtin configuration can regain network access even when the application attempted to block network modules.\n\nThis can allow SSRF-style access to localhost services, metadata endpoints, internal admin panels, or other network resources reachable from the host process.\n\n## Suggested fix\n\nTreat underscored internal network modules as dangerous or link their availability to the public module they wrap.\n\nAt minimum, exclude related internal modules such as:\n\n```text\n_http_agent\n_http_client\n_http_common\n_http_incoming\n_http_outgoing\n_http_server\n_tls_common\n_tls_wrap\n```\n\nAlternatively, deny underscored Node.js internals from wildcard builtin expansion by default.",
  "id": "GHSA-r9pm-gxmw-wv6p",
  "modified": "2026-06-12T19:30:09Z",
  "published": "2026-05-29T18:08:06Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-r9pm-gxmw-wv6p"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-47139"
    },
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/commit/436053e30eecbabd487e2fd2959c137ac34e2bb1"
    },
    {
      "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:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "NodeVM network builtin exclusions bypass via internal _http_client and _http_server"
}


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…