CVE-2026-126199: pgEdge Postgres MCP Server bypassed write confirmation for SELECT INTO and CTEs

The pgEdge Postgres MCP Server classified SQL statements by their first keyword alone, allowing SELECT INTO, data-modifying common table expressions, and EXPLAIN ANALYZE writes to execute without user confirmation on writable connections.

Christopher Ort
By i10X News Desk · Reviewed by Christopher Ort · 2 min read
Share
A developer reviewing SQL query logs on a laptop screen in a dimly lit office, with a PostgreSQL database diagram visible on a second monitor
Image: AI-generated, i10X
On this page
  1. Quick Take
  2. In plain English
  3. What happened
  4. What you should do
  5. What it means
  6. Sources
i10X Quick Take

Quick Take

  1. What: CVE-2026-126199 in pgEdge Postgres MCP Server let SQL writes bypass confirmation prompts in bundled CLI and web clients
  2. Who is affected: Deployments at version 1.0.0 or earlier with allow_writes: true that rely on the confirmation prompt as a control
  3. What to do: Upgrade to version 1.1.0 or later
  4. Severity: Medium (CVSS 6.8)
  5. 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.

Sources

Christopher Ort

Christopher Ort

Christopher Ort is the editor of i10X News at i10x.ai. He has worked hands-on with AI tools, models and agent workflows for years and leads i10X’s coverage of AI launches, funding and research. He is the author of “The Style Penalty”, an SSRN study on how frontier AI models judge AI-written CVs, covered by heise online and t3n.

Editor's picks

  1. Georgia Tech’s Academic AI Playbook: 20 Lessons From 67 Real Courses, Free to Reuse
  2. Arcfront’s $1B Run Rate: What the AI Data Startup Confirms and What It Doesn’t
  3. GPT-6.2 Astra Tops Blueprint-Bench 2, 70% Above May Leader GPT-5.5
  4. Deutsche Telekom Puts 100 Million Euros Into Mistral for Sovereign AI in Germany
  5. Inkling 2 Mini: Thinking Machines’ Looped Open Model Tops Qwen on Coding Tests