npm
CVE-2026-61789
DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation
- Severity
- Medium
- Published
- 2 Nov 2026
- Last changed
- 2 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 0.22.6
- Exploit chance
- 0.4% in the next 30 daysHigher than 33% of CVEs. EPSS by FIRST, 24 Nov 2026
- Also known as
- GHSA-j656-3hf2-fvjc
- Sources
- OSV.dev and GitHub
Description
The read-only mode can be bypassed on the MySQL and MariaDB connectors. In read-only mode a caller can still execute arbitrary write and DDL statements (for example DROP TABLE), which defeats the protection that read-only mode is meant to provide when a database is exposed to an AI agent.
Root cause
The problem is a mismatch between how DBHub's SQL parser handles single-line comments and how MySQL and MariaDB actually parse them.
In src/utils/sql-parser.ts, scanSingleLineComment treats "--" as the start of a comment no matter what character follows it. MySQL and MariaDB only begin a "--" comment when the two dashes are followed by whitespace, a control character, or the end of the line. Otherwise the dashes are read as two minus signs and the rest of the line is ordinary SQL.
The read-only check in src/tools/execute-sql.ts splits the input and validates each statement with isReadOnlySQL, but the connector then executes the original, unmodified string.
Affected software
| Software | Affected versions |
|---|---|
@bytebase/dbhubnpm · osv:npm:@bytebase/dbhub |
|
About @bytebase/dbhub
- Weekly downloads (npm)
- 252,629npm, 23 Nov 2026
Vulnerabilities in @bytebase/dbhub
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-134803DBHub before 1.7.0 Read-Only Mode Bypass via Backslash-Escaped QuotesHigh 7.2 22 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-61789
- GitHub Advisory Database https://github.com/advisories/GHSA-j656-3hf2-fvjc