Case · 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.

Scope

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.

At a glance

Mechanism and trust boundary

  1. 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

  2. 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

  3. 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

Link to claim
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
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

Link to claim
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

Link to claim

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

  1. Nov 15, 2026 · Canonical change recorded · new in release · revision 251