Direct naar de inhoud
⚡ Kritieke cyberalerts voor jouw sector & systemen — direct in je inbox. Aanmelden →
CVE's Videos Dagbriefing

← Terug naar CVE-database

CVE-2026-61789

NONE Gepubliceerd: CWE-436

Beschrijving NL

DBHub is een database MCP-server voor Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Voorafgaand aan 0.22.6 kan alleen-lezen SQL-validatie worden omzeild op de MySQL- en MariaDB-connectoren. In `src/utils/sql-parser.ts` behandelt `scanSingleLineComment` elke dubbele streep als een begin van het commentaar, terwijl MySQL en MariaDB het volgen van witruimte, een controleteken of het einde van de regel vereisen. De read-only check in `src/tools/execute-sql.ts` valideert split statements met `isReadOnlySQL`, maar `src/connectors/mysql/index.ts` en `src/connectors/mariadb/index.ts` voeren de originele string uit met `multipleStatements` ingeschakeld. Een dubbel streepje gevolgd door een niet-witruimte-teken kan daarom een volgende schrijf- of destructieve DDL-instructie verbergen voor de validator, terwijl de database de streepjes interpreteert als min-operators en beide instructies uitvoert. Iedereen die in staat is om de SQL van de assistent te beïnvloeden, inclusief door snelle injectie in inhoud die de assistent leest, kan de alleen-lezen modus omzeilen om databasegegevens te wijzigen of te laten vallen, afhankelijk van de privileges van het databaseaccount. PostgreSQL wordt niet beïnvloed door dit pad omdat de parsering met dubbele streep overeenkomt met de checker en de connector individuele splitsingsinstructies uitvoert. Dit probleem is opgelost in versie 0.22.6.

Origineel (Engels) tonen

DBHub is a database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite. Prior to 0.22.6, read-only SQL validation can be bypassed on the MySQL and MariaDB connectors. In `src/utils/sql-parser.ts`, `scanSingleLineComment` treats every double dash as a comment start, whereas MySQL and MariaDB require following whitespace, a control character, or the end of the line. The read-only check in `src/tools/execute-sql.ts` validates split statements with `isReadOnlySQL`, but `src/connectors/mysql/index.ts` and `src/connectors/mariadb/index.ts` execute the original string with `multipleStatements` enabled. A double dash followed by a non-whitespace character can therefore hide a subsequent write or destructive DDL statement from the validator while the database interprets the dashes as minus operators and executes both statements. Anyone able to influence the assistant's SQL, including through prompt injection in content the assistant reads, can bypass read-only mode to modify or drop database data, subject to the database account's privileges. PostgreSQL is not affected by this path because its double-dash parsing agrees with the checker and its connector executes individual split statements. This issue is fixed in version 0.22.6.

References