Skip to content
MediumVulnerability

GHSA-j656-3hf2-fvjc: DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation

Published
Record updated
View JSON
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.