DBHub read-only mode can still change MySQL and MariaDB
GitHub published GHSA-j656-3hf2-fvjc on 2 November. It is rated medium, and the advisory has no CVE. DBHub is Bytebase’s database MCP server. In versions before 0.22.6, read-only mode on the MySQL and MariaDB connectors can still run writes and DDL, including DROP TABLE. The parser treats every -- as the start of a comment. MySQL and MariaDB start a -- comment only when the dashes are followed by whitespace, a control character, or the end of the line. Otherwise the dashes are two minus signs and the rest of the line is ordinary SQL. The read-only check splits the text and classifies each piece, then the connector executes the original string. Those connectors open the pool with multiple statements enabled. A write placed after -- with no following space can pass the check and still run. GitHub’s check against the project’s own parser accepts that string as one read. The same string, sent to MariaDB 11.4 with multiple statements enabled, runs the read and then drops the table. The advisory says PostgreSQL is not affected by this path: PostgreSQL treats -- as a comment regardless, and it executes each split statement on its own. The report describes the bug on main at commit e99c3aa9, package version 0.22.3.
Read-only mode is the control operators use so an assistant can query a database without changing it. GitHub says anyone who can influence the SQL the assistant sends, most realistically through prompt injection in content the assistant reads, can perform writes and destructive DDL against MySQL and MariaDB. The first patched release is 0.22.6, published 10 July. The new fact is the advisory, published 2 November. The 24 June fix commit is an ancestor of the 0.22.6 tag and of the current release, v1.5.1, published 3 November. That tag’s own notes are other bug fixes. Its MySQL and MariaDB comment scanner still requires whitespace after --.
What to do
If an agent can send SQL through DBHub to MySQL or MariaDB, check the installed @bytebase/dbhub version. Anything before 0.22.6 is in the affected range. Move to 0.22.6 or later. v1.5.1 is the current GitHub release. Until that upgrade, do not treat read-only mode as a guarantee that the assistant cannot change data. PostgreSQL is outside this bypass. If untrusted content could have steered the assistant while an older build was connected, review recent writes and dropped objects on those MySQL and MariaDB databases.
Sources: GitHub Advisory Database, GHSA-j656-3hf2-fvjc, published 2 November; Bytebase DBHub advisory, GHSA-j656-3hf2-fvjc; DBHub release v0.22.6, 10 July; DBHub release v1.5.1, 3 November.