CVE-2026-126197: pgEdge Postgres MCP Server SQL injection through custom pl-do tool parameters
pgEdge Postgres MCP Server enables SQL queries against PostgreSQL databases through Model Context Protocol compatible clients. Prior to 1.1.0, custom pl-do tools interpolated JSON arguments into a PostgreSQL DO block delimited by fixed dollar-quote tags. An argument containing $mcpcustomtool$ could terminate the block and inject arbitrary SQL statements, while $mcpargs$ could inject procedural code into a plpgsql block. Because the statement used the simple query protocol, injected text could include additional statements and transaction control, bypassing readonly and accessing data or modifying resources available to the connecting role. The issue requires at least one pl-do custom tool; sql and pl-func tools pass arguments as bind parameters and are not affected by this injection mechanism. This issue is fixed in 1.1.0.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pgEdge Postgres MCP Serverto a version that resolves this vulnerability.Fixed in 1.1.0
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments running a version prior to 1.1.0 are exposed only if they have at least one custom pl-do tool. The sql and pl-func tool types are not affected by this injection mechanism because they pass arguments as bind parameters.
What access does an attacker need to exploit it?
An attacker needs the ability to supply JSON arguments to an affected custom pl-do tool through a Model Context Protocol-compatible client. Exploitation does not require user interaction and can be performed over the network.
What is the impact of successful exploitation?
Injected SQL can include additional statements and transaction control because the server uses the simple query protocol. An attacker can bypass read_only and read data or modify resources that are available to the database connecting role.
What can be done before upgrading?
Remove or disable custom pl-do tools where possible, since they are the affected tool type. Upgrading to version 1.1.0 fixes the issue.