Published:
Read-only is not a lock: flaws in database MCP servers DBHub, WhoDB and Bagel, one with no confirmed fix
In short: on November 24, 2026, ZDI published a critical DBHub flaw (CVE-2026-136441, CVSS 9.8) with no confirmed fix. Other CVEs that week affect DBHub's read-only mode and the SQL checks in WhoDB and Bagel. An MCP server's read-only mode is a guardrail; the database account determines the real permissions.
A database MCP server lets an AI assistant run SQL queries, for example to answer questions about customers or revenue. Read-only mode is an obvious safeguard. Bytebase's DBHub is one such server. Its npm package was downloaded 150,632 times from November 23 through 29. That includes automated installs.
What is going on with DBHub?
There are two separate flaws:
- CVE-2026-136441 (9.8, critical): no confirmed fix. According to ZDI, the server makes an incorrect authorization decision when parsing untrusted SQL. That lets an attacker bypass authentication without logging in. ZDI reported the flaw on July 18, 2025, and gave notice on November 9, 2026 that it would publish it as a 0-day. No technical details or fixed version are given.
- CVE-2026-134803 (8.1, high): fixed in 1.7.0. DBHub and the database read a backslash-escaped quote differently. What looked like one harmless
SELECTto DBHub was several statements to the database. The reporter used this to switch off the database-level safeguard and then drop a table. It worked on MySQL, MariaDB and PostgreSQL. The fix was released on November 16.
Is the latest DBHub affected by the critical flaw? That has not been publicly established. The CVE record names only a commit from June 5, 2025, when the package was at version 0.4.11. The status of other versions is "unknown". There are 576 commits between that one and version 2.1.0 (November 21, 2026). DBHub added enforcement by the database itself in 0.22.6, and version 2.1.0 uses a real SQL parser for PostgreSQL. Neither is a confirmed fix for this CVE. On November 30, CISA's assessment of the CVE recorded no known exploitation, but did rate exploitation as automatable.
Why does read-only keep failing?
The check must predict what a database will do with SQL. Other servers got this wrong too:
- WhoDB (CVE-2026-138032, 5.3). Its check treated write-capable forms of
SELECT ... INTOas reads. The maintainers confirmed that MySQL wrote a file on the server even in read-only mode. The account did need MySQL'sFILEprivilege. The CVE record suggests 0.132.0 as the cutoff. The maintainers' advisories list 0.134.0, so use that. - Bagel (CVE-2026-138027, 7.5). This server for robotics and IoT data passed model-supplied SQL to DuckDB without a sandbox, through a tool labeled read-only. That allowed file reads, file writes and network requests. Fixed in 2.5.5.
The problem is not new. In August 2025, Datadog described a bypass of the read-only restriction in Anthropic's former reference Postgres server. That npm package is marked as archived, unmaintained and without security guarantees. It still had 112,546 downloads from November 23 through 29. DBHub itself had already received two advisories about its read-only mode in June 2026.
DBHub's documentation is now clear on this point: the mode is a guardrail against unintended writes, not a permission boundary. Some database functions can use files or network connections from an ordinary SELECT. A read-only transaction does not stop that; database privileges do.
Our advice
(1) Isolate DBHub. Keep untrusted users and input away from the server, and disable connections to sensitive data if you can't. In HTTP mode, DBHub listens on all network interfaces by default (0.0.0.0). Limit it to 127.0.0.1 or use a firewall, and set --auth-token. This reduces exposure but is not a confirmed fix. (2) Update anyway: DBHub to at least 1.7.0, WhoDB to 0.134.0 and bagel-mcp to 2.5.5. Replace the archived Postgres server. (3) Set permissions in the database. Create a separate non-admin account for each connection, with read access only to the tables or views it needs. Grant no privileges for file access on the server. (4) Prefer a replica or reporting database with as little personal data as possible. Read-only does not prevent a data leak: anything the account can read can reach the assistant. (5) Test the account itself. In a test environment, try to write without going through the MCP server. The database should refuse. More in MCP security.
What does this mean when you choose a database MCP server?
Don't just ask whether there is a read-only mode; ask what enforces it. A filter in the MCP server is the weakest option, especially if it relies on a list of forbidden words. A transaction the database treats as read-only is a stronger extra layer, but CVE-2026-134803 shows that this could be switched off too. Limited account privileges are the foundation. If you build your own server, offer fixed queries with parameters rather than free-form SQL, and reject anything the check doesn't recognize. See build an MCP server and our data & analytics overview.
The bigger picture: labels such as "read-only" describe an intention; they are not a guarantee. We saw the same with the official Git server. It received another high-severity advisory on November 27: with Git LFS installed, the read tool git_status could still start a program named in the repository's configuration. The patched version is now 2026.11.27. So limit the privileges of the account and process behind a tool.
Sources
- ZDI-26-1067 — (0Day) Bytebase DBHub MCP Incorrect Authorization (November 24, 2026)
- CVE-2026-136441 — DBHub, CVE.org + CISA Vulnrichment (November 24/30, 2026)
- DBHub commit 16e870b (June 5, 2025)
- DBHub: 16e870b...v2.1.0 (GitHub)
- CVE-2026-134803 — DBHub before 1.7.0, read-only mode bypass (CVE.org)
- DBHub issue #504 (November 12, 2026)
- DBHub v1.7.0 (November 16, 2026)
- DBHub v2.1.0 (November 21, 2026)
- DBHub docs — Read-Only Mode (accessed December 1, 2026)
- DBHub docs — Command-Line Options (accessed December 1, 2026)
- GHSA-mwwr-p57h-56pf — Read-only mode does not prevent database writes (June 24, 2026)
- GHSA-j656-3hf2-fvjc — DBHub, MySQL/MariaDB (June 24, 2026)
- CVE-2026-138032 — WhoDB (CVE.org, November 27, 2026)
- GHSA-pvf2-6h4x-r24j — WhoDB, SELECT ... INTO (September 30, 2026)
- GHSA-6mr5-wx6p-65fg — WhoDB, server file operations (September 30, 2026)
- WhoDB 0.134.0 (September 30, 2026)
- CVE-2026-138027 — Bagel (CVE.org, November 27, 2026)
- GHSA-gx2g-3pch-43q5 — Bagel (November 15, 2026)
- Datadog Security Labs — SQL injection in the Postgres MCP server (August 21, 2025)
- npm — downloads @bytebase/dbhub (November 23–29, 2026)
- npm — downloads @modelcontextprotocol/server-postgres (November 23–29, 2026)
- npm — @modelcontextprotocol/server-postgres (deprecated) (accessed December 1, 2026)
- GHSA-6663-fm5v-gqm5 — mcp-server-git, Git LFS filter (November 27, 2026)
- Learnetto — Five new MCP CVEs show why a read-only label is not a security boundary (November 28, 2026)
- i10X News — AI Security This Week (November 30, 2026)
Frequently asked questions
Is there a patch for CVE-2026-136441 in DBHub?
None is confirmed as of December 1, 2026. ZDI lists no fixed version and only advises restricting interaction with the product. The CVE record names one affected commit, from June 2025, and marks other versions as 'unknown'. Version 1.7.0 fixes a different flaw: CVE-2026-134803.
Is an MCP server's read-only mode pointless, then?
No. It helps against an AI assistant's mistakes and is a useful extra layer. But it does not replace database privileges. DBHub's own documentation calls the mode a guardrail, not a permission boundary.
Which WhoDB version fixes these flaws?
Use 0.134.0 or later. The CVE record lists versions before 0.132.0 as affected, but both maintainer advisories give 0.134.0 as the patched version. The 0.134.0 release notes list the fixes too.
Last updated: