Case · DiggingBeagle record

pgEdge MCP row counting permitted subqueries outside the requested table

The pgEdge Postgres MCP Server count_rows tool accepted a where expression containing a subquery against an unrelated table. Repeated counts could reveal facts about that table even when the MCP tool did not expose it by name. The upstream reproducer does not establish a production data leak or a bypass of native PostgreSQL SELECT restrictions.

Scope

An attacker must be permitted to invoke the tool, and the connected PostgreSQL role must already possess some underlying access to the referenced data. A database permission denial still prevents the subquery from reaching an inaccessible table.

Assessment profile

Assessment method
Setting
research demonstration
Exploitation
demonstrated
Evidence
Grade B
Remediation
patch available
AI role
AGAINST AI
Basis and provenance

research_demonstration setting with demonstrated status, based on the identified primary disclosure and its stated test or incident limits. The new Claim distinguishes source observations from hypothetical downstream effects. Impact band is unassigned because the scoped evidence does not justify a comparable quantitative score; no unobserved customer harm or loss is imputed. Remediation state: patch_available.

Assessed Nov 13, 2026 using diggingbeagle.assessment/1.

At a glance

Mechanism and trust boundary

  1. 01

    An attacker must be permitted to invoke the tool, and the connected PostgreSQL role must already possess some underlying access to the referenced data. A database permission denial still prevents the subquery from reaching an inaccessible table.

  2. 02

    The 1.1.0 fix rejects subqueries in that expression. The security boundary should be a deliberately constrained SQL query builder and a least-privilege database role, not the textual label of a read-only tool.

Claims & evidence

CLM-ENR243-022-DETAILThe pgEdge count_rows filter accepted a WHERE subquery that referred to another table, potentially exposing information through repeated result counts even when that table was absent from the MCP tool surface.supported

Basis: reported finding

Link to claim
CLM-R242-PGEDGE-MCP-COUNT-ORACLE-LIMITSThe upstream reproducer does not establish a production data leak or a bypass of native PostgreSQL SELECT restrictions.supported

Basis: reported finding

Link to claim
CLM-R242-PGEDGE-MCP-COUNT-ORACLE-MECHANISMThe pgEdge Postgres MCP Server count_rows tool accepted a where expression containing a subquery against an unrelated table. Repeated counts could reveal facts about that table even when the MCP tool did not expose it by name.supported

Basis: reported finding

Link to claim

Implications

The 1.1.0 fix rejects subqueries in that expression. The security boundary should be a deliberately constrained SQL query builder and a least-privilege database role, not the textual label of a read-only tool.

Controls and mitigations

  • Patch and verify expression parsing across every SQL-like MCP input; limit the service role to intended tables.

Unknowns and contradictions

  • The upstream reproducer does not establish a production data leak or a bypass of native PostgreSQL SELECT restrictions.

Sources and citation

Material revision history

  1. Nov 13, 2026 · Canonical change recorded · new in release · revision 244