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. An attacker must be permitted to invoke the tool, and the connected PostgreSQL role must already possess some underlying access to…
Inspect the ClaimsCase · 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.
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.
Evidence basis: CLM-ENR243-022-DETAIL · CLM-R242-PGEDGE-MCP-COUNT-ORACLE-LIMITS · CLM-R242-PGEDGE-MCP-COUNT-ORACLE-MECHANISM · pgEdge Postgres MCP count_rows SQL injection GHSA-fhv3-x3jh-grj7
At a glance
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.
Read the implicationsThe upstream reproducer does not establish a production data leak or a bypass of native PostgreSQL SELECT restrictions.
Limits and uncertaintyFull account
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.
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. 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.
The upstream reproducer does not establish a production data leak or a bypass of native PostgreSQL SELECT restrictions. Patch and verify expression parsing across every SQL-like MCP input; limit the service role to intended tables.
Evidence reconciliation and effect boundary. The MCP interface exposed a narrower table-oriented read operation than the SQL expression evaluator actually executed. Repeated true/false counts could disclose records from tables the service role was already entitled to read, even if the agent was not supposed to select them through that tool. This does not bypass PostgreSQL permission checks; restricting the database service role remains a separate control. The advisory identifies 1.1.0 as the repair.
Mechanism and trust boundary
- 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.
- 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
- supportspgEdge Postgres MCP count_rows SQL injection GHSA-fhv3-x3jh-grj7primary disclosure
GHSA-fhv3-x3jh-grj7, PoC and Fix, count_rows WHERE expression
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
- supportspgEdge Postgres MCP count_rows SQL injection GHSA-fhv3-x3jh-grj7primary disclosure
Impact, count_rows Boolean subquery and 1.1.0 repair
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
- supportspgEdge Postgres MCP count_rows SQL injection GHSA-fhv3-x3jh-grj7primary disclosure
Impact, count_rows Boolean subquery and 1.1.0 repair
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
- Nov 13, 2026 · Canonical change recorded · new in release · revision 244