Quick Take
- What: CVE-2026-126199 in pgEdge Postgres MCP Server let SQL writes bypass confirmation prompts in bundled CLI and web clients
- Who is affected: Deployments at version 1.0.0 or earlier with
allow_writes: truethat rely on the confirmation prompt as a control - What to do: Upgrade to version 1.1.0 or later
- Severity: Medium (CVSS 6.8)
- Status: Patch available in 1.1.0
In plain English
The pgEdge Postgres MCP Server is a tool that lets AI assistants run SQL queries against PostgreSQL databases. Before version 1.1.0, when a user had write access enabled, the tool was supposed to ask for confirmation before running any command that changes data. However, it only looked at the first word of the command to decide whether to ask. This meant that certain write commands starting with reading words like SELECT, WITH, or EXPLAIN could run without asking the user first.
What you should do: If you use this tool to connect AI assistants to your database, upgrade to version 1.1.0. If you are not a developer using this specific MCP server tool, you can ignore this issue.
What happened
The bundled CLI and web clients in pgEdge Postgres MCP Server classified SQL statements for write confirmation by examining only the first keyword. Any statement beginning with SELECT, WITH, or EXPLAIN was treated as a read and executed without prompting the user.
This classification flaw allowed three categories of write operations to bypass confirmation:
- SELECT … INTO statements, which create and populate a table
- Data-modifying common table expressions (CTEs) beginning with WITH, such as
WITH d AS (DELETE FROM t RETURNING 1) SELECT 1 - EXPLAIN ANALYZE of any write statement, which executes the statement rather than only planning it
The vulnerability affected connections configured with allow_writes: true in versions 1.0.0 and earlier, including all alpha and beta pre-releases. Read-only connections remained protected by PostgreSQL’s transaction access mode, which refuses writes at the database level regardless of client behavior.
The issue was disclosed in GitHub security advisory GHSA-5gmh-9683-hhq9 and assigned CVE-2026-126199 with a CVSS score of 6.8.
What you should do
Upgrade to version 1.1.0 or later. The fixed version classifies statements against comment-stripped, literal-blanked code, preventing keywords inside strings or comments from being mistaken for actual SQL keywords.
Review your database audit logs for writes made through query_database that you did not expect, particularly statements beginning with WITH, SELECT … INTO, or EXPLAIN ANALYZE.
As a workaround for deployments that cannot immediately upgrade, leave allow_writes disabled or connect with a database role that has no write privileges, so the database refuses writes regardless of client prompts.
What it means
The confirmation prompt in the bundled clients is a user-interface feature, not a security boundary. Version 1.1.0 corrects which statements trigger the prompt, but a statement whose writes occur inside a function it calls will still appear as a SELECT. The server-side transaction access mode on read-only connections remains the authoritative control preventing unauthorized writes.
The fix in pull request #233 moved the SQL scanner from internal/tools/readonly_guard.go to internal/sqltext and added classification logic that detects SELECT … INTO, data-modifying CTEs, and EXPLAIN ANALYZE. SELECT … FOR UPDATE and EXPLAIN without ANALYZE continue to be treated as reads.



