---
title: pgEdge Postgres MCP Server: 'read_only' could be bypassed with ordinary transaction SQL, letting an agent create, alter and drop tables (CVE-2026-126196, CVSS 8.1; fixed in 1.1.0) | ctxsec
url: https://ctxsec.com/items/pgedge-postgres-mcp-cve-2026-126196-read-only-bypass-sql-statement-smuggling-fixed-1-1-0
description: "pgEdge's advisory says any caller able to make tool calls against a read-only connection could write to the database anyway through the query_database tool, on versions 1.0.0 and earlier (including all alpha and beta pre-releases), when the connecting role held write privileges. Several weaknesses combined: the guard only matched the literal TRANSACTION_READ_ONLY strings, read detection was a prefix check (a leading comment defeated it), non-reads went through pgx Exec without bind parameters so PostgreSQL's simple query protocol accepted multiple semicolon-separated statements, some tools set READ ONLY after BEGIN instead of on it, and RESET ALL/DISCARD ALL on a pooled connection could leave it writable for later calls and other tokens. pgEdge engineering demonstrated the bypass on a throwaway PostgreSQL 17.10 instance. Version 1.1.0 forces the extended query protocol (one statement per message) on read-only connections. A related route via custom pl-do tool parameters is GHSA-r5pp-jx86-r6r9."
status: "official (GitHub advisory GHSA-j7mp-839j-jrm7; CVE-2026-126196 published to NVD Nov 12, 2026); fixed in 1.1.0; no exploitation reported"
published: 2026-11-14
---

> pgEdge's advisory says any caller able to make tool calls against a read-only connection could write to the database anyway through the query_database tool, on versions 1.0.0 and earlier (including all alpha and beta pre-releases), when the connecting role held write privileges. Several weaknesses combined: the guard only matched the literal TRANSACTION_READ_ONLY strings, read detection was a prefix check (a leading comment defeated it), non-reads went through pgx Exec without bind parameters so PostgreSQL's simple query protocol accepted multiple semicolon-separated statements, some tools set READ ONLY after BEGIN instead of on it, and RESET ALL/DISCARD ALL on a pooled connection could leave it writable for later calls and other tokens. pgEdge engineering demonstrated the bypass on a throwaway PostgreSQL 17.10 instance. Version 1.1.0 forces the extended query protocol (one statement per message) on read-only connections. A related route via custom pl-do tool parameters is GHSA-r5pp-jx86-r6r9.

[← Context & Harness Attacks](/context) · [markdown](/items/pgedge-postgres-mcp-cve-2026-126196-read-only-bypass-sql-statement-smuggling-fixed-1-1-0.md)

official (GitHub advisory GHSA-j7mp-839j-jrm7; CVE-2026-126196 published to NVD Nov 12, 2026); fixed in 1.1.0; no exploitation reported

2026-11-14 11:40 AM ET

### pgEdge Postgres MCP Server: 'read_only' could be bypassed with ordinary transaction SQL, letting an agent create, alter and drop tables (CVE-2026-126196, CVSS 8.1; fixed in 1.1.0)

- **Upgrade:** pgEdge Postgres MCP Server to 1.1.0 or later (released Sept 4, 2026; the CVE was only published Nov 12).
- **Real fix for any database MCP:** connect agents with a role that can't write (for example one granted only `pg_read_all_data` or SELECT on specific schemas). A tool's read-only flag is a convenience, not a security boundary.
- **Prompt-injection angle:** an agent that reads untrusted text and holds a 'read-only' DB tool could be steered into destructive SQL on unpatched versions.

Sources: [pgEdge: GHSA-j7mp-839j-jrm7, read-only mode bypass by SQL statement smuggling](https://github.com/pgEdge/pgedge-postgres-mcp/security/advisories/GHSA-j7mp-839j-jrm7) · [NVD: CVE-2026-126196](https://nvd.nist.gov/vuln/detail/CVE-2026-126196) · [pgEdge Postgres MCP Server v1.1.0 release](https://github.com/pgEdge/pgedge-postgres-mcp/releases/tag/v1.1.0)
