A Postgres MCP server placed arguments inside fixed dollar-quoted procedural SQL, so a crafted tool argument could become executable SQL under the connecting database role. An argument containing a fixed delimiter can terminate the generated SQL literal; the server previously sent the combined block through a protocol that permitted multiple statements.…
Inspect the ClaimsCase · DiggingBeagle record
pgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions
A Postgres MCP server placed arguments inside fixed dollar-quoted procedural SQL, so a crafted tool argument could become executable SQL under the connecting database role.
pgEdge Postgres MCP Server through 1.0.0 with a registered custom pl-do tool and a caller who can invoke that tool.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- Evidence
- Grade B
- Remediation
- patch available
- AI role
- AGAINST AI
Basis and provenance
The maintainer fixes the route in version 1.1.0. Actual customer compromise is not documented, and the permission ceiling is the database role. 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 affected custom pl-do path is a separate authority boundary from the read-only pooled-query flaw, even though both can cause unintended SQL execution.
Assessed Nov 15, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-R245-PGEDGE-CUSTOM-PLDO-SQL-01 · CLM-R245-PGEDGE-CUSTOM-PLDO-SQL-02 · CLM-R246-PGEDGE-CUSTOM-PLDO-SQL-BOUNDARY · CLM-ENR250-09 · pgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions (original advisory or patch)
At a glance
No publicly documented customer exploitation or production loss; custom sql and pl-func tools use bound parameters and are outside this specific interpolation flaw. No evidence here establishes the number of production victims or a broader failure rate outside the cited evaluation.
Limits and uncertaintyFull account
A Postgres MCP server placed arguments inside fixed dollar-quoted procedural SQL, so a crafted tool argument could become executable SQL under the connecting database role.
An argument containing a fixed delimiter can terminate the generated SQL literal; the server previously sent the combined block through a protocol that permitted multiple statements. The maintainers describe arbitrary SQL execution under the connecting role as a possible result and specify version 1.1.0 as the fix; changing the role to a least-privilege database account independently limits the effect.
No publicly documented customer exploitation or production loss; custom sql and pl-func tools use bound parameters and are outside this specific interpolation flaw.
The privilege boundary is the PostgreSQL role behind the MCP server. For custom pl-do tools, untrusted JSON arguments were inserted inside fixed dollar-quoted blocks. An input that included the closing delimiter could escape from data into executable statements; the pgx simple-protocol path could accept multiple statements. Disabling query_database did not remove the custom-tool entry point. The resulting authority was no greater than the connected database role, but an application-level read_only label could not protect a write-capable role.
The vendor fix creates unpredictable per-invocation delimiters and rejects collisions, with additional statement hardening in version 1.1.0. That prevents this particular payload construction but does not confirm whether a deployed role was already used to alter data. Existing grants and audit logs therefore matter independently of the version upgrade, and the separate query_database pool-state vulnerability should not be counted as a second exploit of the same code path.
Mechanism and trust boundary
- 01
Entry or starting condition
An MCP deployment exposes a custom pgEdge PostgreSQL tool of type pl-do and accepts caller-controlled JSON arguments.
Boundary: attacker or research precondition
- 02
Crossing the relevant boundary
Fixed dollar-quote delimiters are used when embedding argument text in a DO block; a crafted argument closes the quote and injects statements within the connecting role.
Boundary: mechanism and authorization boundary
- 03
Observed or reported result
The maintainer fixes the route in version 1.1.0. Actual customer compromise is not documented, and the permission ceiling is the database role.
Boundary: measured outcome and evidentiary limit
Claims & evidence
CLM-ENR250-09The pgEdge advisory describes the fix as replacing predictable dollar-quote boundaries with invocation-specific delimiter handling and safer quoting, while separately noting that custom sql and pl-func tools already used bound parameters. The patch addresses the custom pl-do interpolation path, not every possible unsafe procedural definition in PostgreSQL.supported
Basis: reported finding
- supportspgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions (original advisory or patch)primary disclosure
GHSA-r5pp-jx86-r6r9, vulnerable custom pl-do interpolation and patch description
CLM-R245-PGEDGE-CUSTOM-PLDO-SQL-01The maintainers describe arbitrary SQL execution under the connecting role as a possible result and specify version 1.1.0 as the fix; changing the role to a least-privilege database account independently limits the effect.supported
Basis: reported finding
- supportspgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions (original advisory or patch)primary disclosure
Impact, affected and patched versions
CLM-R245-PGEDGE-CUSTOM-PLDO-SQL-02An argument containing a fixed delimiter can terminate the generated SQL literal; the server previously sent the combined block through a protocol that permitted multiple statements.supported
Basis: reported finding
- supportspgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions (original advisory or patch)primary disclosure
Description of fixed dollar-quote tags and the custom pl-do path
CLM-R246-PGEDGE-CUSTOM-PLDO-SQL-BOUNDARYThe maintainer identifies custom pl-do tools through pgEdge Postgres MCP Server 1.0.0 as vulnerable to dollar-quote delimiter collisions and records 1.1.0 as fixed; custom sql and pl-func tools use bound parameters and are outside this specific injection path.supported
Basis: reported finding
- supportspgEdge custom procedural MCP tools could execute caller-controlled SQL through delimiter collisions (original advisory or patch)primary disclosure
GHSA-r5pp-jx86-r6r9, Description, Who is affected and Patches
Unknowns and contradictions
- No publicly documented customer exploitation or production loss; custom sql and pl-func tools use bound parameters and are outside this specific interpolation flaw.
- 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