What happened
DBHub's SQL parser misclassifies double-dash as a comment start, so the read-only validation can be bypassed on the MySQL/MariaDB connectors, letting a client issue writes that should have been blocked.
Why it matters
DBHub is an MCP server that gives AI agents database access. A bypassable read-only guard means a prompt-injected or malicious agent can mutate production data through a connector the operator believed was read-only.
Attack vector
The read-only SQL validator treats every double-dash as a comment start, whereas MySQL/MariaDB do not; a client can smuggle a statement past the guard and execute writes against a connector that is supposed to be read-only.
Affected systems
DBHub prior to 0.22.6 — src/utils/sql-parser.ts scanSingleLineComment.
Mitigation
Upgrade to DBHub 0.22.6 or later (commit 872bb33); if on an affected version, keep the MySQL/MariaDB read-only connectors off untrusted agent clients.