← All advisories

CVE-2026-138032mediumUnsafe agent actions2026-11-27

CVE-2026-138032: WhoDB's MCP whodb_query tool let SELECT ... INTO, OUTFILE and server file functions bypass read-only mode and write confirmation

WhoDB is an open-source database manager whose CLI ships an MCP server so AI agents can query databases. Its sqlguard classifier treated any statement starting with SELECT as a read unless it contained a listed mutating keyword, and INTO, OUTFILE and DUMPFILE were missing. An MCP client or a prompt-injected model could therefore run SELECT ... INTO (creating PostgreSQL tables), MySQL SELECT ... INTO OUTFILE/DUMPFILE, or file functions like pg_read_file, lo_export and LOAD_FILE without the approval promised by --confirm-writes, and on MySQL even in read-only mode. Impact is bounded by the database account's own privileges.

01.

What it is

GHSA-pvf2-6h4x-r24j: SELECT ... INTO <table>, INTO OUTFILE and INTO DUMPFILE were classified as non-mutating, skipping the MCP --confirm-writes prompt; MySQL read-only mode still wrote the file (PostgreSQL read-only transactions, added in 0.130.0, blocked the table write).

GHSA-6mr5-wx6p-65fg: read-shaped server file operations (PostgreSQL pg_read_file and lo_export, MySQL LOAD_FILE and INTO OUTFILE/DUMPFILE) ran without confirmation in default and --read-only modes when the DB account had the privileges; the --security=strict substring checks could be bypassed (e.g. a newline between INTO and OUTFILE).

Preconditions: someone who can invoke whodb_query (a connected MCP client or an agent following injected instructions) and a database account with CREATE, FILE or server-file privileges.

Affected: WhoDB >= 0.88.0. The CVE record says fixed in 0.132.0; both GitHub advisories (published 30 September 2026) list 0.134.0 as the first patched version, released the same day. NVD published the CVE on 27 November 2026. Reported by Syed Anas Mohiuddin.

02.

How to check

  1. Check your WhoDB version (whodb --version or the Docker tag): versions from 0.88.0 below 0.134.0 should be treated as affected.
  2. Check which database account the WhoDB MCP server uses and whether it holds PostgreSQL superuser/pg_read_server_files/pg_write_server_files or MySQL FILE privileges.
03.

How to fix

  1. Upgrade WhoDB to 0.134.0 or later.
  2. Connect the MCP server with a dedicated least-privilege account without server-file privileges; set MySQL secure_file_priv to a safe directory.
  3. Don't rely on keyword-based read-only or confirmation modes as the only control when an agent may read untrusted content.
-- MySQL: make sure the WhoDB account has no FILE privilege
SHOW GRANTS FOR 'whodb'@'%';
REVOKE FILE ON *.* FROM 'whodb'@'%';
-- PostgreSQL: check for server-file roles
SELECT rolname FROM pg_roles WHERE pg_has_role('whodb', oid, 'member') AND rolname IN ('pg_read_server_files','pg_write_server_files','pg_execute_server_program');
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.