The where parameter of the pgEdge Postgres MCP Server count_rows tool has an SQL injection vulnerability
pgEdge Postgres MCP Server SQL injection in the count_rows where parameter
The count_rows tool of pgEdge Postgres MCP Server has an SQL injection vulnerability (GHSA-fhv3-x3jh-grj7, CVE-2026-125322); versions 1.0.0 and earlier (including all alpha and beta pre-releases) are affected, and it has been fixed in 1.1.0. The vulnerability lies in insufficient validation of the where parameter: a caller able to invoke the tool can embed a subquery referencing other tables and use the returned row count as an oracle to infer, predicate by predicate, the contents of tables the tool was never asked to query. Affected are deployments where the connection role can read data beyond what the deployer intended to expose; normal use of the tool is unaffected. After the fix, the where parameter rejects subqueries; before the fix, the maintainers reproduced the extraction against a running server, and after the fix confirmed it failed and completed verification by trying multiple variants; the temporary mitigation is to grant the connection role SELECT privileges only on the tables the deployer intends to expose.