GHSA-j656-3hf2-fvjc: DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation
- Identifier
- GHSA-j656-3hf2-fvjc
- Published
- Record updated
- Affected
- @bytebase/dbhub < 0.22.6
- Fixed in
- 0.22.6
- released June 24, 2026, 131 days before disclosure
Summary
DBHub's read-only mode can be bypassed on its MySQL and MariaDB connectors. The SQL parser treats "--" as a comment even when MySQL and MariaDB would not, so a payload such as "SELECT 1--1;DROP TABLE victim" passes the read-only check while the database executes the DROP TABLE, which allows writes and DDL when a database is exposed to an AI agent. The advisory states that PostgreSQL is not affected by this path.
Mitigation
The source suggests running only the validated statements instead of the original string and disabling multipleStatements on the MySQL and MariaDB connections unless it is required. As defense in depth, it suggests making the comment scanner dialect-aware so that for MySQL and MariaDB "--" starts a comment only when followed by whitespace, a control character, or the end of the line.
Related items
- MediumCritical Langflow Flaws Could Let Unauthenticated Attackers Run Code on ServersSimilar attack · The Hacker News
- LowChainalysis Discloses Data Breach Following AI-Driven CyberattackSimilar attack · SecurityWeek
- CriticalPrefab UI is vulnerable to Remote Code Execution via a Pyodide js Bridge to DenoSimilar attack · JFrog Security Research (Vulnerabilities)
- CriticalBeta9 is vulnerable to Host Filesystem Exposure via Volume Path TraversalSimilar attack · JFrog Security Research (Vulnerabilities)
- CriticalBeta9 is vulnerable to a Container Escape via Unvalidated Sandbox File PathsSimilar attack · JFrog Security Research (Vulnerabilities)