{"question":"We use WhoDB's MCP server so an AI assistant can query our PostgreSQL and MySQL databases, with --read-only on some and --confirm-writes on others. A CVE for WhoDB's whodb_query tool was published November 27, 2026. Could the assistant have written files or created tables without asking, which version fixes it, and what else should we change?","slug":"can-whodbs-mcp-read-only-mode-stop-select-into-file-writes-cve-2026-138032","url":"https://www.rightshold.com/answers/can-whodbs-mcp-read-only-mode-stop-select-into-file-writes-cve-2026-138032","short_answer":"Before the fix, yes. CVE-2026-138032 (GHSA-rv9x-jh6w-58xh, published November 27, 2026, CVSS 4.0 score 6.0) says WhoDB from 0.88.0 classified SQL for the MCP whodb_query tool with a keyword list that left out INTO, OUTFILE and DUMPFILE. So read-shaped statements such as PostgreSQL SELECT ... INTO a new table, MySQL SELECT ... INTO OUTFILE or DUMPFILE, and PostgreSQL lo_export ran without the approval --confirm-writes promises, and some got through --read-only. WhoDB's own advisories (GHSA-pvf2-6h4x-r24j and GHSA-6mr5-wx6p-65fg, from September 30, 2026) confirmed files created on the database host and new tables in PostgreSQL, bounded by what the connected database account may do. The fix replaced the keyword list with a fail-closed read grammar. Its commit is in 0.132.0, which is the version the CVE names; WhoDB's advisories list 0.134.0 as patched and its release notes name both fixes. The CVE arrived two months after the fix, so the real exposure is a WhoDB that was pinned and never upgraded. Upgrade to 0.134.0 or later (0.139.0 was current on November 28) and connect with an account that has no FILE, CREATE or server-file privileges.","checklist":["Check every WhoDB install that serves MCP, Community and Enterprise editions alike (they share the CLI/MCP code): from 0.88.0 up to 0.131.0 is affected. Upgrade to 0.134.0 or later; 0.139.0 was released November 17, 2026.","Give the account WhoDB connects with only the reads it needs. On MySQL, no FILE privilege; on PostgreSQL, no superuser, no pg_read_server_files or pg_write_server_files, and no CREATE in schemas the assistant can reach.","On MySQL, set secure_file_priv to a directory nothing reads from, or to NULL to turn server-side file import and export off.","Look on database hosts for files you didn't create in directories the database process can write, and in PostgreSQL for tables made by WhoDB's account that nobody asked for.","Don't count on --security=strict as the fix for older versions. WhoDB's advisory says putting a newline between INTO and OUTFILE got past its substring check and still wrote a file.","Treat read-only and confirm-writes as one layer. The database's own permissions are the layer that holds when a classifier is wrong.","Keep a dated note of the WhoDB version, the account grants and the flags you run, so an incident review can tell which period was exposed."],"sections":[{"heading":"What CVE-2026-138032 let whodb_query do","points":["WhoDB decides whether a query from the MCP whodb_query tool is a read before applying --read-only and --confirm-writes. Before the fix, a statement starting with SELECT counted as a read unless it contained a word from a list of mutating keywords, and INTO, OUTFILE and DUMPFILE weren't on it.","WhoDB's advisory GHSA-pvf2-6h4x-r24j lists confirmed examples: SELECT * INTO a new table, which creates and fills a table in PostgreSQL, and SELECT ... INTO OUTFILE or INTO DUMPFILE, which write files on the MySQL server. The maintainers reproduced these end to end against 0.131.0. With --confirm-writes, no confirmation was asked for.","The companion advisory GHSA-6mr5-wx6p-65fg adds read-shaped file operations: PostgreSQL pg_read_file and lo_export, and MySQL LOAD_FILE, ran without confirmation in both the default and --read-only modes when the account had the privileges. A caller only needs a way to get whodb_query called, such as a connected MCP client or instructions an agent accepts; the advisory says prompt injection is plausible but wasn't demonstrated."]},{"heading":"What read-only mode did and didn't stop","points":["On PostgreSQL, --read-only did block SELECT ... INTO a table, because 0.130.0 had added a database-enforced read-only transaction. That protection came from the database, not from WhoDB's classifier.","On MySQL 8.4, --read-only still let INTO OUTFILE write a file, because MySQL permits that server-side file operation inside the transaction mode WhoDB used. And the PostgreSQL file functions ran in read-only mode when the account was privileged enough.","The limits come from the database too. PostgreSQL table creation needs CREATE in the schema, MySQL file writes need FILE and are confined by secure_file_priv, existing files can't be overwritten, and ordinary accounts without server-file privileges were refused in WhoDB's tests. The worst case is WhoDB connected as a superuser or an account with file privileges."]},{"heading":"What the fix changed and why the late CVE matters","points":["The fix commit (September 29, 2026) replaces the keyword list as the automatic-execution boundary with a bounded read grammar. Anything outside it counts as a write: unrecognised syntax, routine calls beyond standard aggregates, SELECT INTO, OUTFILE and DUMPFILE. It needs confirmation in the default mode and is refused in read-only mode. Protected reads also go through each connector's read-only path, and unsupported connectors are refused rather than run normally.","The 0.134.0 release notes, September 30, 2026, list fixes for both advisories among several others. The repository advisory text still says no patched release exists, but its patched-version field reads 0.134.0, so use that as the floor.","GitHub's advisory database and the CVE only appeared on November 27, 2026. Anyone who pinned WhoDB in a container or a desktop install before October and hasn't upgraded is still running the old classifier, and scanners that key on CVEs only started flagging it now."]}],"checks":[],"ask_rightshold":{"start":"https://www.rightshold.com/start?ref=seo","mcp_endpoint":"https://www.rightshold.com/mcp","ask":"Record a receipt for our WhoDB CVE-2026-138032 cleanup: the version we moved to, the reduced database grants, and a hash of the file-and-table audit from the database hosts.","mcp_call":{"tool":"record_action","arguments":{"action_type":"security.incident_cleanup","outcome":"success","occurred_at":"2026-11-28T20:00:00Z","client_event_id":"whodb:cve-2026-138032:cleanup","summary":"WhoDB upgraded from 0.129.0 to 0.139.0 on CLI MCP and desktop installs; MySQL FILE privilege revoked and secure_file_priv set; PostgreSQL account without CREATE or server-file roles; audited database hosts for unexpected files and tables created by the WhoDB account, none found","action_sha256":"<sha256 of the audit report and the exported grants>"}},"also":["Needs your API key (or accept_terms:true once to open a free account; the key comes back once). It returns a ledger-committed receipt of what you submitted and when, kept outside WhoDB and your databases.","It doesn't scan WhoDB, query your databases or verify the audit. It shows the report you hashed existed at that time and hasn't changed since, not that nothing was missed."],"scope":"Rightshold isn't affiliated with WhoDB or Clidey. Details are from GitHub's advisory database entry GHSA-rv9x-jh6w-58xh (CVE-2026-138032), WhoDB's repository advisories GHSA-pvf2-6h4x-r24j and GHSA-6mr5-wx6p-65fg, the fix commit and the 0.134.0 release notes, with the current release from WhoDB's GitHub releases, all read November 28, 2026. Advisories get updated; confirm affected and fixed versions on the linked pages."},"sources":[{"title":"GitHub Advisory Database: GHSA-rv9x-jh6w-58xh / CVE-2026-138032, WhoDB MCP read-only bypass via server-side file writes","url":"https://github.com/advisories/GHSA-rv9x-jh6w-58xh"},{"title":"WhoDB security advisory GHSA-pvf2-6h4x-r24j: SELECT ... INTO bypasses read-only mode and the write-approval gate","url":"https://github.com/clidey/whodb/security/advisories/GHSA-pvf2-6h4x-r24j"},{"title":"WhoDB security advisory GHSA-6mr5-wx6p-65fg: MCP read-only and confirmation gates allow privileged database server file operations","url":"https://github.com/clidey/whodb/security/advisories/GHSA-6mr5-wx6p-65fg"},{"title":"WhoDB 0.134.0 release notes (September 30, 2026)","url":"https://github.com/clidey/whodb/releases/tag/0.134.0"},{"title":"WhoDB fix commit: update for protected reads (September 29, 2026)","url":"https://github.com/clidey/whodb/commit/9de47fb365dda639aded842ec332cdc399b9939b"}],"related":[{"title":"How to restrict an MCP database tool to read-only queries","url":"https://www.rightshold.com/answers/how-to-restrict-an-mcp-database-tool-to-read-only-queries"},{"title":"Can an MCP tool marked read-only write files (AWS Pricing MCP Server CVE-2026-126816)?","url":"https://www.rightshold.com/answers/can-an-mcp-tool-marked-read-only-write-files-aws-pricing-mcp-server-cve-2026-126816"},{"title":"Which AWS Labs Postgres, MySQL and DocumentDB MCP server versions fix the read-only mode bypasses?","url":"https://www.rightshold.com/answers/which-aws-labs-postgres-mysql-and-documentdb-mcp-server-versions-fix-the-read-only-mode-bypasses"},{"title":"Why an MCP server's tool deny list can silently miss dangerous calls","url":"https://www.rightshold.com/answers/why-an-mcp-servers-tool-deny-list-can-silently-miss-dangerous-calls"}],"computed_from":"Curated guidance; license verdicts computed from Rightshold's license profiles at render time. Not legal advice.","updated":"2026-11-28"}