Description
DBHub is a database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Prior to 0.22.6, read-only SQL validation can be bypassed on the MySQL and MariaDB connectors. In `src/utils/sql-parser.ts`, `scanSingleLineComment` treats every double dash as a comment start, whereas MySQL and MariaDB require following whitespace, a control character, or the end of the line. The read-only check in `src/tools/execute-sql.ts` validates split statements with `isReadOnlySQL`, but `src/connectors/mysql/index.ts` and `src/connectors/mariadb/index.ts` execute the original string with `multipleStatements` enabled. A double dash followed by a non-whitespace character can therefore hide a subsequent write or destructive DDL statement from the validator while the database interprets the dashes as minus operators and executes both statements. Anyone able to influence the assistant's SQL, including through prompt injection in content the assistant reads, can bypass read-only mode to modify or drop database data, subject to the database account's privileges. PostgreSQL is not affected by this path because its double-dash parsing agrees with the checker and its connector executes individual split statements. This issue is fixed in version 0.22.6.
Published: 2026-10-30
Score: 6.1 Medium
EPSS: n/a
KEV: No
Impact: Bypass of read‑only SQL validation allowing data modification or destructive actions
Action: Apply Patch
AI Analysis

Impact

DBHub’s MySQL and MariaDB connectors incorrectly treat a double dash as the start of a comment regardless of following whitespace or control characters. The read‑only check splits statements on the original string, but the connector executes the original string with multiple statements enabled. Consequently a double dash followed by a non‑whitespace character can conceal a subsequent write or destructive DDL statement. An attacker who can influence the SQL sent to DBHub—such as through prompt injection—can therefore execute hidden statements that alter or delete database data according to the database account’s privileges.

Affected Systems

The vulnerability affects DBHub version 0.22.5 and earlier for the MySQL and MariaDB connectors. The affected product is bytebase:dbhub. The issue is resolved in release 0.22.6.

Risk and Exploitability

The CVSS score is 6.1, indicating a moderate severity level. The EPSS score is not available and the vulnerability is not listed in the CISA KEV catalog, suggesting no current widespread exploitation. The likely attack vector involves injecting SQL through an interface that forwards queries to DBHub, such as a chat‑assistant or application that processes user content. Attackers can bypass read‑only mode and perform writes or destructive DDL based on the privileges of the database account used by DBHub.

Generated by OpenCVE AI on October 30, 2026 at 17:25 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update DBHub to version 0.22.6 or later, where the comment parsing logic and statement execution have been corrected.
  • If a newer version cannot be installed immediately, disable the multipleStatements option in the MySQL/MariaDB connectors and enforce manual statement splitting before execution.
  • Implement additional validation to reject any statement containing a double dash not followed by whitespace, a control character, or end of line, ensuring that only truly read‑only queries are permitted.

Generated by OpenCVE AI on October 30, 2026 at 17:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 30 Oct 2026 16:30:00 +0000

Type Values Removed Values Added
Description DBHub is a database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Prior to 0.22.6, read-only SQL validation can be bypassed on the MySQL and MariaDB connectors. In `src/utils/sql-parser.ts`, `scanSingleLineComment` treats every double dash as a comment start, whereas MySQL and MariaDB require following whitespace, a control character, or the end of the line. The read-only check in `src/tools/execute-sql.ts` validates split statements with `isReadOnlySQL`, but `src/connectors/mysql/index.ts` and `src/connectors/mariadb/index.ts` execute the original string with `multipleStatements` enabled. A double dash followed by a non-whitespace character can therefore hide a subsequent write or destructive DDL statement from the validator while the database interprets the dashes as minus operators and executes both statements. Anyone able to influence the assistant's SQL, including through prompt injection in content the assistant reads, can bypass read-only mode to modify or drop database data, subject to the database account's privileges. PostgreSQL is not affected by this path because its double-dash parsing agrees with the checker and its connector executes individual split statements. This issue is fixed in version 0.22.6.
Title DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation
Weaknesses CWE-436
CWE-863
References
Metrics cvssV4_0

{'score': 6.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-30T16:08:24.224Z

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

Link: CVE-2026-61789

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Deferred

Published: 2026-10-30T17:17:26.743

Modified: 2026-10-30T17:17:26.867

Link: CVE-2026-61789

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-30T17:30:13Z

Weaknesses