Description
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.
Published: 2026-09-24
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution via arbitrary file write and command execution
Action: Patch Immediately
AI Analysis

Impact

DBHub’s read‑only mode was incorrectly implemented before version 0.22.6. The configuration flag that should enable PostgreSQL’s default_transaction_read the service to rely on a simple keyword classifier. With a regular database role this allows tampering with sequences, while a privileged role enables arbitrary file writes via lo_export, arbitrary file reads via pg_read_file, and remote code execution through dblink combined with COPY … TO PROGRAM. The CVSS score of 7.4 reflects the severity of these mitigations. EPSS data is not available, and the vulnerability is not listed in CISA’s KEV catalog.

Affected Systems

Bytebase DBHub prior to version 0.22.6 on any of its supported databases—Postgres, MySQL, SQL Server, Oracle, MariaDB, or SQLite—faces this issue. The component exposes an unauthenticated HTTP transport bound to 0.0.0.0, making the /mcp endpoint reachable by any network caller.

Risk and Exploitability

Because the endpoint is unauthenticated and listens on all interfaces, an attacker can submit malicious SQL via /mcp from any connected network. With a standard role, the attacker can compromise sequence integrity; with elevated privileges, the attacker can write arbitrary files to the server, read host files, and gain remote code execution. The CVSS score of 7.4 indicates a high risk, while the lack of EPSS data suggests moderate probability of exploitation based on current evidence. The absence from KEV further indicates no known widespread exploitation, but existing impact potential warrants immediate action.

Generated by OpenCVE AI on September 25, 2026 at 05:46 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade bytebase/dbhub to version 0.22.6 or later to correct the read‑only enforcement.
  • Restrict exposure of the /mcp endpoint by binding it to a local interface, applying firewall rules, or enabling authentication and TLS so that only trusted hosts can reach it.
  • Validate that database roles for DBHub are minimal and that the ‘readonly’ configuration is correctly applied; avoid using privileged accounts for normal operations.

Generated by OpenCVE AI on September 25, 2026 at 05:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mwwr-p57h-56pf @bytebase/dbhub's read-only mode does not prevent database writes
History

Fri, 25 Sep 2026 14:45:00 +0000

Type Values Removed Values Added
First Time appeared Bytebase
Bytebase dbhub
Vendors & Products Bytebase
Bytebase dbhub

Thu, 24 Sep 2026 17:45:00 +0000

Type Values Removed Values Added
Description 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.
Title @bytebase/dbhub's read-only mode does not prevent database writes
Weaknesses CWE-184
CWE-636
CWE-863
References
Metrics cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-24T17:37:40.409Z

Reserved: 2026-07-10T20:06:05.616Z

Link: CVE-2026-61788

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-24T18:17:16.837

Modified: 2026-09-24T18:17:16.837

Link: CVE-2026-61788

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-25T14:16:34Z

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs

  • CWE-636

    Not Failing Securely ('Failing Open')

  • CWE-863

    Incorrect Authorization