All vulnerabilities

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
Weakness
CWE-436Incorrect authorization (CWE-863)
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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
@bytebase/dbhubnpm · osv:npm:@bytebase/dbhub
  • Every version before 0.22.6

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
Search the list for @bytebase/dbhub

References