Guides · 30 November 2026 · Free tool, no sign-in
The read-only guard that cannot see the second statement
Short answer: yes, a stacked statement can hide inside a string literal. A backslash before a quote makes a vulnerable checker keep reading as if it were still inside the string. The database ends the string at that same quote. Whatever sits after it (a DROP, an INSERT, a COMMIT, a SET that turns the read-only flag off) is executed as a fresh statement the guard never inspected. This page runs both parsers side by side on the same text, so the disagreement stops being a claim and becomes a table you can point at.
Database MCP servers such as DBHub are now the front door between AI agents and production data. The pitch is tidy: give the agent an execute_sql tool, switch on read-only mode, and the agent can answer questions without being able to change anything. The safety of that arrangement rests on one component most people never look at — the string scanner that decides where a statement ends. If that scanner and the database disagree about where a string literal ends, the read-only check is auditing a different query from the one the database runs. CVE-2026-134803, fixed in DBHub 1.7.0, is exactly that disagreement, and it carries a CVSS-adjacent lesson the whole category should learn: the checker is only as good as its tokeniser.
Run the fuzzer
Paste one SQL payload, or several stacked with semicolons, into the box. Add your DBHub version if you know it; the version decides the two advisory verdicts under the result. The fuzzer splits your text twice. The first split uses the vulnerable scanner's rules, where a backslash escapes the quote after it. The second uses PostgreSQL's rules, where it does not. Each statement each parser finds is then classified as a read, a write, DDL, transaction control, or a SET. A payload earns ESCAPES-READONLY when the database side holds something dangerous that the checker side cannot see at all.
Honest scope: This fuzzer analyses SQL text with two parsers and executes nothing: it opens no connection, imports no database driver, and never sends a payload anywhere. The vulnerable side is a faithful model of the scanner behaviour described for CVE-2026-134803 — a model, not the DBHub binary — and the database side models PostgreSQL string rules with standard_conforming_strings on. A verdict tells you what each parser sees in the text; it is not a live test of your server, and other databases tokenise strings differently. The text you paste is analysed in memory for this one run and rendered back to you; it is not stored, and it is never sent to any database. Sibling tools on this site take the same parser-first approach to other agent surfaces: the agent approval policy audit lints the policy file that governs an approving agent, and the skill-file audit reads agent skill files for undisclosed egress.
How a string literal hides a second statement
Read the known-positive payload slowly, the way two different readers would. It is: SELECT id FROM users WHERE name = 'a\'; DROP TABLE users; --'. Start with the database. PostgreSQL, running with standard_conforming_strings on — the default since version 9.1, released in 2011 — treats a backslash inside an ordinary string literal as a plain character with no special power. The literal therefore runs from the first quote to the quote right after the backslash: the string is a\, and it is over. A semicolon follows. Semicolons end statements. So a second statement begins, and it is DROP TABLE users. A third fragment follows, starting with two dashes, which makes it a comment, and comments are ignored. Net result for the database: one small SELECT, one table dropped.
Now hand the same bytes to the vulnerable scanner, the scanSingleQuotedString routine in DBHub releases before 1.7.0. That scanner was written with C-style habits: a backslash escapes whatever follows it, so the quote after the backslash is an escaped quote, part of the string rather than its end. The scanner keeps reading. The semicolon? Inside the string. The words DROP TABLE users? Inside the string. The comment marker, the final quote — that final quote is the first unescaped one the scanner meets, so the string ends there, at the very end of the input. Net result for the checker: one statement, a SELECT, with a slightly odd name in the WHERE clause. Read-only check passed. The guard and the database read the same bytes and produced different programs, and in security the reader that executes is the one whose reading counts.
Two advisories, two different shapes of trouble
CVE-2026-134803 is the parser bug this page demonstrates. It affects DBHub before 1.7.0, it is specific, and it has a clean remedy: upgrade, because 1.7.0 is the line where the scanner's string handling was corrected. A team on 1.6.x with read-only mode enabled had a control that reported success while doing nothing against this payload class — the worst kind of control failure, because every audit log along the way says the check ran and passed.
CVE-2026-136441 is the uglier companion. It is an authentication issue in DBHub rated CVSS 9.8, and at the time this page was written there is no fixed release. A parser bug can be patched; an unpatched authentication hole has to be lived with, carefully, until it is not one anymore. The practical reading is plain. Do not put a database MCP server on a network path that unauthenticated callers can reach. Keep it local or on a private segment, put something that authenticates in front of it, and inventory who can reach the port today rather than after the upgrade ticket closes. The fuzzer's version check states this verdict for every version it is given, because a version string cannot clear an advisory that has no fixed release.
The quiet variants are the dangerous ones
A hidden DROP TABLE announces itself in the wreckage. The corpus includes two quieter shapes because they are what a careful attacker reaches for first. In one, the stacked statement is SET transaction_read_only = off. Nothing is written, nothing is dropped; a session flag flips, and every statement after it in that session runs writable. In the other, the stacked statement is a COMMIT, which ends the read-only transaction itself, followed by a DELETE that now runs outside any read-only transaction at all. Both payloads are one escaped quote long. Both verdict ESCAPES-READONLY here, and both are invisible to a checker whose string scanner swallows them. When you review your own guard, ask it about flags and transaction control, not only about INSERT and DROP. A checker that pattern-matches a short list of write keywords will miss the statements that merely unlock the door.
What to rely on instead
The fix that survives the next parser bug is boring, and it lives in the database. Connect the MCP server with a login role that holds no INSERT, UPDATE, DELETE or DDL grants on anything it should not change. Set default_transaction_read_only for that role, so a fresh session starts read-only at the server rather than at the client's request. Refuse multi-statement input at the driver, because legitimate read questions are single statements and stacking is the entire attack surface on this page. Keep the client-side read-only scan switched on — it catches honest mistakes, and honest mistakes are common — but file it under convenience, not under boundary. Then run this corpus against your own stack whenever the guard changes. The controls in the corpus matter as much as the escapes: a plain SELECT, a doubled quote, and a semicolon inside a literal must all come back READ-ONLY-SAFE, or the replacement checker is crying wolf and will be switched off by Christmas.
Frequently asked questions
Does this tool execute my SQL against a database?
No. Nothing is executed, ever. The fuzzer reads your SQL text with two parsers — a model of the vulnerable DBHub scanner and a model of PostgreSQL string rules — and reports what each parser sees. It opens no connection, imports no database driver, and sends your payload nowhere.
What exactly goes wrong in CVE-2026-134803?
DBHub releases before 1.7.0 scan single-quoted strings with a scanner that treats a backslash as an escape character, so a backslash-quote inside a literal does not end the string for the checker. PostgreSQL, with standard_conforming_strings on, treats that backslash as an ordinary character and ends the string at the quote. A stacked statement placed after the quote is therefore inside the string for the checker and a real second statement for the database.
My DBHub is on the latest version. Am I clear?
For CVE-2026-134803, version 1.7.0 and later are past the fixed line. CVE-2026-136441 is a separate authentication issue, CVSS 9.8, with no fixed release — being current does not clear it. What clears it is not exposing the server without authentication in front of it.
Why is SET transaction_read_only = off treated as dangerous?
Because it is the point of the exercise. A read-only transaction stays read-only only while that flag holds. A stacked SET that flips it to off, or a stacked COMMIT that ends the read-only transaction before the write, removes the protection without the payload ever containing an obvious write of its own.
What should I rely on instead of a client-side read-only check?
Enforce read-only in the database itself: a login role with no write or DDL grants, default_transaction_read_only set for that role, and one statement per call at the driver. A client-side string scan can stay as a convenience, but the grant list is the boundary that survives a parser bug.
Sources
- DBHub — Bytebase's database MCP server (source, releases, security advisories)
- PostgreSQL documentation — lexical structure: string constants and dollar-quoted strings
- PostgreSQL documentation — SET TRANSACTION and transaction_read_only
This page was published on 30 November 2026. The payload corpus and the two advisory verdicts reflect the DBHub advisories as recorded on that date: CVE-2026-134803 affecting releases before 1.7.0, and CVE-2026-136441 (CVSS 9.8) with no fixed release. If a fixed release for the second advisory has since shipped, the version check here will be updated — and the database-side advice stands either way, because grant lists do not expire. Questions and corrections: support@getingeniousai.com.