{"id":"GHSA-j656-3hf2-fvjc","revision":null,"records":[{"revision":"eba6d30c31484237bad3c395878788f4","observedAt":"2026-11-06T18:02:40.711+00:00","statement":{"source":"cve-program","id":"CVE-2026-61789","aliases":[],"title":"DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation","description":"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.","state":0,"publishedAt":"2026-10-30T16:08:24.224+00:00","modifiedAt":"2026-11-06T16:25:27.915+00:00","affected":[{"ecosystem":"Vendor product","name":"dbhub","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"bytebase\",\n                    \"product\": \"dbhub\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 0.22.6\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":6.1,"severity":"MEDIUM"}],"references":["https://github.com/bytebase/dbhub/security/advisories/GHSA-j656-3hf2-fvjc","https://github.com/bytebase/dbhub/pull/342","https://github.com/bytebase/dbhub/commit/872bb338f7d31f6afe517a076ac3e3edafaaaf08","https://github.com/bytebase/dbhub/releases/tag/v0.22.6"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-61789","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-61789","identifiers":["CVE-2026-61789"]},"retained":false,"historicalAffected":[]},{"revision":"f00bdd3d6f564a94a27710574dcc4955","observedAt":"2026-11-14T21:28:19.419+00:00","statement":{"source":"euvd","id":"EUVD-2026-114181","aliases":["CVE-2026-61789","GHSA-j55q-p8qc-f6wg"],"title":"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` tr…","description":"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.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":6.1,"severity":null}],"references":["https://github.com/bytebase/dbhub/security/advisories/GHSA-j656-3hf2-fvjc","https://github.com/bytebase/dbhub/pull/342","https://github.com/bytebase/dbhub/commit/872bb338f7d31f6afe517a076ac3e3edafaaaf08","https://github.com/bytebase/dbhub/releases/tag/v0.22.6"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-114181","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 30, 2026, 4:08:24 PM","dateUpdated":"Nov 6, 2026, 4:25:27 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-114181","identifiers":["EUVD-2026-114181","CVE-2026-61789","GHSA-j55q-p8qc-f6wg"]},"retained":false,"historicalAffected":[]},{"revision":"eec74bbcfd844133b78dee26712e665a","observedAt":"2026-11-06T19:10:24.155+00:00","statement":{"source":"nvd","id":"CVE-2026-61789","aliases":[],"title":"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` tr…","description":"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.","state":0,"publishedAt":"2026-10-30T17:17:26.743+00:00","modifiedAt":"2026-11-06T17:18:32.84+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":6.1,"severity":"MEDIUM"}],"references":["https://github.com/bytebase/dbhub/commit/872bb338f7d31f6afe517a076ac3e3edafaaaf08","https://github.com/bytebase/dbhub/pull/342","https://github.com/bytebase/dbhub/releases/tag/v0.22.6","https://github.com/bytebase/dbhub/security/advisories/GHSA-j656-3hf2-fvjc"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-61789","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-436","CWE-863"],"productCriteria":[],"sourceDates":{"published":"2026-10-30T17:17:26.743","lastModified":"2026-11-06T17:18:32.840"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-61789","identifiers":["CVE-2026-61789"]},"retained":false,"historicalAffected":[]},{"revision":"babd747ec802458cb7dafee306e5d966","observedAt":"2026-11-02T18:57:38.594+00:00","statement":{"source":"osv","id":"GHSA-j656-3hf2-fvjc","aliases":["CVE-2026-61789"],"title":"DBHub: MySQL and MariaDB comment interpretation bypasses read-only SQL validation","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.\n\nRoot cause\n\nThe problem is a mismatch between how DBHub's SQL parser handles single-line comments and how MySQL and MariaDB actually parse them.\n\nIn 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.\n\nThe 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. The MySQL and MariaDB connectors open their connection pool with multipleStatements: true (src/connectors/mysql/index.ts:54 and src/connectors/mariadb/index.ts:53) and run the whole string in a single call.\n\nBecause of this, the following payload:\n\n    SELECT 1--1;DROP TABLE victim\n\nis seen by DBHub as a single SELECT statement, since everything after \"--\" is treated as a comment and the read-only check passes. MySQL and MariaDB instead parse it as \"SELECT 1 - -1\" followed by \"DROP TABLE victim\" and execute both statements.\n\nProof of concept\n\n1) DBHub's own parser. Running splitSQLStatements and isReadOnlySQL from this repository on the payload returns a single statement and readOnly = true, so the query is allowed in read-only mode. The same code correctly rejects \"SELECT 1; DROP TABLE victim\", which confirms that the \"--1\" is what gets through.\n\n2) Execution. Connecting to MariaDB 11.4 with mysql2 and multipleStatements: true (the same option the connector uses) and sending the payload returns 2 for the first statement, which confirms \"--\" was not treated as a comment, and then drops the table. The table exists before the call and is gone afterwards.\n\nImpact\n\nRead-only mode is the control operators rely on to let an assistant read from a database without being able to change it. With this bypass, anyone who can influence the SQL the assistant sends, most realistically through prompt injection in content the assistant reads, can perform writes and destructive DDL against MySQL and MariaDB. PostgreSQL is not affected by this path, because it treats \"--\" as a comment regardless and executes each split statement individually.\n\nAffected code (current main, commit e99c3aa9, package version 0.22.3)\n\n- src/utils/sql-parser.ts — scanSingleLineComment does not require whitespace after \"--\"\n- src/tools/execute-sql.ts — validates the split statements but executes the original string\n- src/connectors/mysql/index.ts and src/connectors/mariadb/index.ts — multipleStatements: true\n\nSuggested fix\n\nThe most reliable fix is to stop executing the original string: run only the statements that were validated, and disable multipleStatements on the MySQL and MariaDB connections unless it is genuinely required. As defense in depth, make the comment scanner dialect-aware so that for MySQL and MariaDB \"--\" only starts a comment when it is followed by whitespace, a control character, or the end of the line, similar to the handling already in place for MySQL conditional comments.","state":0,"publishedAt":"2026-11-02T17:57:51+00:00","modifiedAt":"2026-11-02T18:15:06.0815937+00:00","affected":[{"ecosystem":"npm","name":"@bytebase/dbhub","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.22.6"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/bytebase/dbhub/security/advisories/GHSA-j656-3hf2-fvjc","https://github.com/bytebase/dbhub/pull/342","https://github.com/bytebase/dbhub/commit/872bb338f7d31f6afe517a076ac3e3edafaaaf08","https://github.com/bytebase/dbhub","https://github.com/bytebase/dbhub/releases/tag/v0.22.6"],"sourceUrl":"https://github.com/advisories/GHSA-j656-3hf2-fvjc","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-j656-3hf2-fvjc","identifiers":["GHSA-j656-3hf2-fvjc","CVE-2026-61789"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-16T02:40:55.5499298+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T02:40:55.5499298+00:00","lastSuccessAt":"2026-11-16T02:40:55.7011971+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:55.701198+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-6be044d0e08779dadd136f949a536de4047af96f5d7bceb7e190ecffbb8f18ca-c752a1e051b8643685216373385073bf944fdf6392f01fe9214ca3f5c0dd4bf5","complete":true,"records":425877,"lastAttemptAt":"2026-11-16T02:40:54.3961015+00:00","lastSuccessAt":"2026-11-16T02:40:54.3873111+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:54.3961015+00:00","snapshotPublishedAt":"2026-11-16T02:27:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-c8efcdf585474f84baf9354ab84917e1","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T02:50:41.5560063+00:00","lastSuccessAt":"2026-11-16T02:50:41.552+00:00","error":"53 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T02:50:41.552+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13821,"expectedIdentifiers":13874,"failedIdentifiers":53},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-16T02:40:55.5499298+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T02:40:55.5499298+00:00","lastSuccessAt":"2026-11-16T02:40:55.7026168+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:55.7026173+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-6af984755aaa43ed805ae31084d25516","complete":true,"records":13833,"lastAttemptAt":"2026-11-16T02:41:00.5806007+00:00","lastSuccessAt":"2026-11-16T02:41:00.576+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:41:00.576+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13874,"expectedIdentifiers":13874,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T02:40:55.0296372+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:55.0296372+00:00","snapshotPublishedAt":"2026-11-14T13:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T02:40:54.5424991+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:54.5424991+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-16T02:40:55.4326019+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:55.4326019+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-e77c8ea93875d599a3ee92fde74c7150d1a28eacc697b92dc129baff6877c60e","complete":true,"records":232477,"lastAttemptAt":"2026-11-16T02:40:54.9249792+00:00","lastSuccessAt":"2026-11-16T01:07:48.2266333+00:00","error":null,"lastVerifiedAt":"2026-11-16T02:40:54.9249792+00:00","snapshotPublishedAt":"2026-11-16T01:03:09+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}