Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-61789— DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation

Quick assessment

Affected
bytebase dbhub
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

DBHub 是一款支持 Postgres、MySQL、SQL Server、Oracle、MariaDB 和 SQLite 的数据库模型上下文协议(MCP)服务器。在 0.22.6 版本之前,MySQL 和 MariaDB 连接器的只读 SQL 验证机制可被绕过。问题根源在于 中的 函数将任意双连字符( )均视为注释起始,而 MySQL 和 MariaDB 的实际规范要求双连字符后必须紧跟空白字符、控制字符或行尾才能构成注释。 尽管 中的只读检查逻辑通过 对拆分后的语句进行了验证,但 和 在启用 选项时,会直接执行

CVSS 6.1 · Medium EPSS 0.39% · P33

Affected Version Matrix 1

VendorProduct Version RangeStatus
bytebase dbhub < 0.22.6 affected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-61789

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
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
Source: CVE Program / CVE List V5
Vulnerability Type
解释冲突
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
bytebase dbhub < 0.22.6 -

II. Public POCs for CVE-2026-61789

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-61789

请登录查看更多情报信息。

Patches & Fixes for CVE-2026-61789 (1)

Vendor Advisories for CVE-2026-61789 (1)

IV. Related Vulnerabilities