A tool advertised as read-only trusted statement-prefix checks rather than a transaction and role boundary, allowing writes when PostgreSQL credentials retained write grants. Unsupported SQL transaction and session variants could reach a multipstatement simple-query execution path, and altered connection settings could persist when the same pooled…
Inspect the ClaimsCase · DiggingBeagle record
pgEdge read-only MCP query mode could run writes and contaminate pooled session state
A tool advertised as read-only trusted statement-prefix checks rather than a transaction and role boundary, allowing writes when PostgreSQL credentials retained write grants.
pgEdge Postgres MCP Server through 1.0.0 where query_database is enabled and the connecting DB role can write despite application read_only.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- Evidence
- Grade B
- Remediation
- patch available
- AI role
- AGAINST AI
Basis and provenance
The maintainer reproduced DDL changes; version 1.1.0 adds single-statement execution and pooled-state reset, while actual deployed-tenant harm remains unknown. Classified as research_demonstration with exploit status demonstrated. Evidence grade B reflects the original paper or maintainer advisory and its stated limitations, not an independent audit of all deployments. Comparable realized harm is not established, so impact stays unrated; remediation status patch_available is limited to the cited experiment or affected software version. New source-specific boundary: The fixed dispatcher and pooled-connection reset address different effects: an immediate injected write and a writable session inherited by a later request.
Assessed Nov 15, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-R245-PGEDGE-READONLY-SQL-POOL-01 · CLM-R245-PGEDGE-READONLY-SQL-POOL-02 · CLM-R246-PGEDGE-READONLY-SQL-POOL-BOUNDARY · CLM-ENR250-11 · pgEdge read-only MCP query mode could run writes and contaminate pooled session state (original advisory or patch)
At a glance
An underlying PostgreSQL role with no write grants blocks the described writes independently. The advisory does not establish exploitation in production or new unauthorized read access. No evidence here establishes the number of production victims or a broader failure rate outside the cited evaluation.
Limits and uncertaintyFull account
A tool advertised as read-only trusted statement-prefix checks rather than a transaction and role boundary, allowing writes when PostgreSQL credentials retained write grants.
Unsupported SQL transaction and session variants could reach a multipstatement simple-query execution path, and altered connection settings could persist when the same pooled connection served another request. The vendor reproduced table creation, alteration and deletion in disposable PostgreSQL and documented version 1.1.0 fixes including single-statement extended execution and connection-state reset.
An underlying PostgreSQL role with no write grants blocks the described writes independently. The advisory does not establish exploitation in production or new unauthorized read access.
The server enforced read_only using application checks and transaction/session settings, yet the underlying PostgreSQL role could still write. Statement classification missed legal SQL spellings and the simple protocol permitted more than one command. Some read-only settings were applied after transaction start, while RESET or DISCARD could alter defaults that survived connection reuse. The scope therefore extends from one malicious query to subsequent requests borrowing the same database session, including requests with a different MCP token.
The maintainer reproduced DDL effects on a disposable database, which is stronger evidence than a speculative escape string but not evidence of a customer breach. Version 1.1.0 switches to one-statement execution, strengthens transaction and session guards and resets pooled connections before reuse, discarding a connection if restoration fails. The independent safeguard is to grant the connecting database role only read privileges; a parser or pool fix cannot compensate for an unnecessarily privileged service account.
Mechanism and trust boundary
- 01
Entry or starting condition
An MCP query_database tool is labelled read_only while its pooled PostgreSQL role still has write grants.
Boundary: attacker or research precondition
- 02
Crossing the relevant boundary
Statement smuggling or transaction/session commands bypass the application guard, and a changed session default can persist in the pool.
Boundary: mechanism and authorization boundary
- 03
Observed or reported result
The maintainer reproduced DDL changes; version 1.1.0 adds single-statement execution and pooled-state reset, while actual deployed-tenant harm remains unknown.
Boundary: measured outcome and evidentiary limit
Claims & evidence
CLM-ENR250-11The pgEdge read-only remediation combines single-statement extended-query execution with resetting the PostgreSQL session before returning it to the pool; a connection that cannot be safely reset must be discarded. A PostgreSQL login without database write grants remains a separate least-privilege boundary even when application-level read-only checks fail.supported
Basis: reported finding
- supportspgEdge read-only MCP query mode could run writes and contaminate pooled session state (original advisory or patch)primary disclosure
GHSA-j7mp-839j-jrm7, patches, connection cleanup and least-privilege database-role workaround
CLM-R245-PGEDGE-READONLY-SQL-POOL-01The vendor reproduced table creation, alteration and deletion in disposable PostgreSQL and documented version 1.1.0 fixes including single-statement extended execution and connection-state reset.supported
Basis: reported finding
- supportspgEdge read-only MCP query mode could run writes and contaminate pooled session state (original advisory or patch)primary disclosure
Impact, confirmed local write operations and affected versions
CLM-R245-PGEDGE-READONLY-SQL-POOL-02Unsupported SQL transaction and session variants could reach a multipstatement simple-query execution path, and altered connection settings could persist when the same pooled connection served another request.supported
Basis: reported finding
- supportspgEdge read-only MCP query mode could run writes and contaminate pooled session state (original advisory or patch)primary disclosure
Root causes and 1.1.0 mitigation description
CLM-R246-PGEDGE-READONLY-SQL-POOL-BOUNDARYThe maintainer reproduced table creation, alteration and deletion against a disposable database while relying on application read_only; RESET ALL or DISCARD ALL could also leave a pooled PostgreSQL session writable for later requests.supported
Basis: reported finding
- supportspgEdge read-only MCP query mode could run writes and contaminate pooled session state (original advisory or patch)primary disclosure
GHSA-j7mp-839j-jrm7, Description, reproduced DDL effects, pooled session state, Patches
Unknowns and contradictions
- An underlying PostgreSQL role with no write grants blocks the described writes independently. The advisory does not establish exploitation in production or new unauthorized read access.
- No evidence here establishes the number of production victims or a broader failure rate outside the cited evaluation.
Sources and citation
Material revision history
- Nov 15, 2026 · Canonical change recorded · new in release · revision 251