Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach unauthenticated /mcp on 0.0.0.0
-
DeliveryCall execute_sql assuming enforced read-only
-
ExploitSubmit SELECT wrapping side-effect function
-
ExecutionInvoke dblink + COPY TO PROGRAM as privileged role
-
ImpactAchieve RCE and host file read/write
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation completeness
|
| Exploitation Conditions | Requires DBHub to be run with the HTTP transport, which is unauthenticated and binds to 0.0.0.0 by default, exposing /mcp to any network caller. Basic exploitation (bypassing the readonly=true setting on execute_sql via a SELECT that calls a side-effecting function) works against any connected database because the read-only connector enforcement is dead code gated on an unpopulated config value, leaving only a first-keyword classifier. The high-impact outcomes are conditional on the database connection role: an ordinary role permits only limited sequence tampering, whereas a privileged PostgreSQL role is required for arbitrary host file write (lo_export), arbitrary host file read (pg_read_file), and remote code execution (dblink + COPY ... TO PROGRAM). Limiting factors: the worst impacts depend on a privileged DB role, and exposure depends on the operator choosing the HTTP transport rather than stdio; all versions before 0.22.6 are affected. |
| Impact | This is a genuine high-priority issue for anyone running DBHub's HTTP transport, though the raw CVSS 7.4 slightly understates the worst case while overstating the common case. The NVD vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N marks it network-reachable and unauthenticated (PR:N), consistent with the description's statement that the HTTP transport is unauthenticated and binds 0.0.0.0 by default, making /mcp reachable by any network caller. AC:H is defensible because the severe impacts (arbitrary host file read via pg_read_file, arbitrary file write via lo_export, and RCE via dblink + COPY ... TO PROGRAM) require the DBHub connection to run under a privileged database role; with only an ordinary role, impact drops to limited sequence tampering (I:L). I dispute A:N - COPY ... TO PROGRAM yields command execution on the database host, which should carry availability impact (A:H), and one could argue S:C since the executing/impacted component (the DB server host) differs from the vulnerable MCP component. No EPSS score, no CISA KEV listing, and no public POC were provided, so there is no evidence of active exploitation; this is a real, remotely-triggerable design flaw (broken read-only enforcement, CWE-184) rather than a confirmed campaign. Priority is driven by trivial network reachability of the default HTTP binding plus a full RCE path when a privileged DB role is in use - a common real-world configuration for a database tool. |
| Exploit ScenarioDerived | An attacker on the same network (or the internet, where the 0.0.0.0-bound HTTP transport is exposed) sends an MCP request to the unauthenticated /mcp endpoint calling execute_sql, which the operator believes is locked to read-only. They submit a SELECT that invokes a side-effecting function - e.g. dblink() with COPY ... TO PROGRAM - which the first-keyword classifier passes as 'read-only,' achieving arbitrary command execution on the database host when DBHub connects with a privileged role. No public exploit code was identified at time of analysis, but the technique is described concretely in the advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 24, 2026
DBHub's readonly = true option on its execute_sql tool fails to enforce read-only database access in versions prior to 0.22.6, because the connector code that would set PostgreSQL default_transaction_read_only=on and open SQLite in read-only mode is gated on a configuration value that is never populated. With only a first-keyword classifier left as a guard, any SELECT that calls a side-effecting function passes, allowing sequence tampering with an ordinary role and, with a privileged PostgreSQL role, arbitrary host file write via lo_export, arbitrary host file read via pg_read_file, and remote code execution via dblink combined with COPY ... TO PROGRAM. The HTTP transport is unauthenticated (CVSS vector PR:N) and binds to 0.0.0.0 by default, so any network caller of /mcp can reach the vulnerable tool; CVSS is 7.4 (AV:N/AC:H) and no public exploit code has been identified at time of analysis, though the vendor-released patch 0.22.6 resolves the issue.
RemediationAI
Upgrade DBHub to 0.22.6, the vendor-released patch version, which fixes the read-only enforcement as documented in advisory GHSA-mwwr-p57h-56pf (https://github.com/bytebase/dbhub/security/advisories/GHSA-mwwr-p57h-56pf). Until upgrading, do not rely on readonly = true on execute_sql - it provides no real protection - and prefer the stdio transport over HTTP, since that removes the network-reachable attack surface entirely at the cost of only being usable by local MCP clients. If HTTP transport is required, restrict exposure by binding to loopback instead of 0.0.0.0 and firewall or reverse-proxy restricting access to /mcp, accepting that this merely reduces reachability and does not fix the bypass. Reduce blast radius by connecting with a least-privileged database role: avoid superusers and any role with pg_read_server_files/pg_write_server_files, revoke EXECUTE on dblink, and remove lo_export/pg_read_file/COPY ... TO PROGRAM capability where possible - these cuts prevent the file read/write and RCE outcomes but still leave sequence tampering possible, so they are compensating controls, not substitutes for the 0.22.6 upgrade.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
DBHub is a database MCP (Model Context Protocol) server that exposes database access as tools to MCP clients, supporting Postgres, MySQL, SQL Server, Oracle, MariaDB and SQLite through per-engine connectors. The intended read-only protection had two layers: connector-level enforcement (PostgreSQL default_transaction_read_only=on, SQLite opened with the readOnly flag) and a statement classifier. CWE-184 (Incomplete List of Disallowed Inputs) captures the root cause here: the connector-level enforcement is dead code because it is gated on a config value that is never populated, leaving only a check on the first keyword of each statement. That classifier can be trivially bypassed by a SELECT whose expression calls a function with side effects, since statement classification never inspects function semantics. The impact then depends entirely on the privileges of the configured database role: an unprivileged role limits an attacker to sequence manipulation, while a PostgreSQL role with elevated rights unlocks server-side primitives such as lo_export, pg_read_file, dblink and COPY ... TO PROGRAM. Exposure is governed by the transport choice: the HTTP transport is unauthenticated and listens on 0.0.0.0 by default, making /mcp reachable by any network caller, whereas stdio transport is not remotely reachable. The affected CPE covers the full bytebase:dbhub product line, i.e. all releases before 0.22.6.
Know when Dbhub gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Unauthenticated network reach to default 0.0.0.0 /mcp (PR:N, AV:N); AC:H because full C/I/A impact requires a privileged DB role; RCE via COPY TO PROGRAM justifies A:H over NVD's A:N.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
DBHub is a database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Prior to version 0.22.6, setting readonly = true on the execute_sql tool does not make the connection read-only. The connectors are written to set PostgreSQL default_transaction_read_only=on (and open SQLite in readOnly mode), but that code is gated on a config value that is never populated, so it never runs. The only thing left enforcing read-only is a classifier that inspects the first keyword of each statement. Any SELECT that writes or has side effects through a function call passes it. With an ordinary role this allows sequence tampering; with a privileged role it allows writing arbitrary files on the server (lo_export), reading arbitrary host files (pg_read_file), and remote code execution (dblink + COPY ... TO PROGRAM). The HTTP transport is unauthenticated and binds to 0.0.0.0 by default, so this is reachable by any network caller of /mcp. Version 0.22.6 patches the issue.
Articles & Coverage 1
Technical POC Analysis
CWE-184 (incomplete list of disallowed inputs), with the advisory also mapping CWE-636 (failing open) and CWE-863 (incorrect authorization).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 public PoC link from github
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
DBHub versions prior to 0.22.6 fail to enforce read-only database access, allowing unauthenticated network attackers to tamper with data, read and write files on the host, and potentially execute remote code when privileged database roles are used. This HIGH severity vulnerability (CVSS 7.4) affects any organization exposing the DBHub /mcp endpoint, which binds to all network interfaces by default, and no public exploit identified at time of analysis. Leadership should prioritize immediate patching and network exposure reduction to mitigate the risk of data integrity loss, unauthorized file access, and full system compromise.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-86326
GHSA-mwwr-p57h-56pf
NVD
CVE.org
EPSS
Exploit-DB