Skip to main content

pgEdge Postgres MCP CVE-2026-126196

| EUVDEUVD-2026-124566 HIGH
SQL Injection (CWE-89)
2026-11-12 GitHub_M
8.1
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain query_database tool access on read_only connection
  2. Delivery
    Submit statement evading read detection (leading comment)
  3. Exploit
    pgx selects simple query protocol
  4. Execution
    Smuggle semicolon-separated transaction/access-mode change
  5. Persist
    Execute DDL/DML writes as write-capable role
  6. Impact
    Compromise database integrity and availability

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concrete conditions, all stated by the vendor: (1) the caller can issue tool calls against the server's query_database (or count_rows/execute_explain) tool on a connection configured as read_only; (2) the deployment relies on read_only as a safety boundary; and (3) the PostgreSQL role used for the connection actually holds write privileges - every write still passes the database's own permission check. Concrete trigger paths include sending a statement not matching the SELECT/WITH/TABLE/VALUES prefix (a leading comment suffices, so no unusual keyword is needed), which routes through tx.Exec without bind parameters and selects the simple query protocol accepting multiple semicolon-separated statements; smuggled SET TRANSACTION READ WRITE or COMMIT; BEGIN READ WRITE then enables writes. Pooled session state is a secondary condition: a RESET ALL or DISCARD ALL clearing default_transaction_read_only left later callers on that pooled connection writable. LIMITING factors: the connecting role must have write privileges (granting no write privileges fully blocks the bypass per the vendor workaround), the server must be running 1.0.0 or earlier, and connections configured with allow_writes: true are out of scope since they were never a read-only boundary.

Impact

This is a genuine read-only-boundary bypass in pgEdge Postgres MCP Server, not merely a high-CVSS paper risk, but its reach is gated by preconditions. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H, base 8.1) correctly reflects a network-reachable, low-complexity flaw requiring some privilege (PR:L): the caller must be able to issue query_database tool calls, and the underlying database role must already hold write privileges. Impact is High to integrity and availability with no confidentiality impact, which matches the advisory's statement that a read-only connection already permitted reads. No EPSS score is provided and the CVE is not in CISA KEV, so there is no signal of widespread or automated exploitation; the only demonstrated exploitation is pgEdge's own engineering proof against a throwaway PostgreSQL 17.10 instance, which is not public working exploit code. The vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a serious-but-not-under-active-attack finding. Note a source discrepancy worth recording: NVD assigns CWE-89 (SQL Injection) while the vendor GHSA assigns CWE-693 (Protection Mechanism Failure); the mechanism is statement smuggling that defeats the read_only guardrail rather than classic data-exfiltration SQLi, so the GHSA framing is more precise. The practical priority is elevated for anyone who treats read_only as a security boundary while connecting with a write-capable role.

Exploit ScenarioDerived

An actor who can reach the MCP server's query_database tool on a connection documented as read_only - for example a semi-trusted LLM client or a user expected to have read-only access - sends a statement that is not recognized as a read (including one hidden behind a leading comment), causing pgx to use PostgreSQL's simple query protocol. They append transaction-control or access-mode statements (e.g. SET TRANSACTION READ WRITE or COMMIT; BEGIN READ WRITE) and then create, alter, or drop objects, provided the connecting role holds write privileges. No public exploit code was identified at time of analysis, though pgEdge engineering demonstrated the bypass internally; attack complexity is low once tool access and a write-capable role are present.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 12, 2026

Read-only mode in pgEdge Postgres MCP Server 1.0.0 and earlier can be bypassed through the query_database tool, allowing an authenticated caller holding a write-privileged database role to create, alter, or drop objects despite the documented read_only safety boundary. The bypass chains prefix-only read detection, execution of unrecognized statements via pgx Exec without bind parameters (which selects the PostgreSQL simple query protocol and accepts multiple semicolon-separated statements), and pooled session state that can retain a cleared default_transaction_read_only. Integrity and availability impact is High while confidentiality is unaffected because the connection already permits reads; no public exploit code was identified at time of analysis, although pgEdge engineering demonstrated the bypass internally against a throwaway PostgreSQL 17.10 instance.

RemediationAI

Upgrade to pgEdge Postgres MCP Server 1.1.0 or later, which is the vendor-released fixed version: on read-only connections every query_database statement now runs through the extended query protocol so multi-statement requests are rejected before execution, the statement guard inspects statements with comments removed and literals blanked and rejects read-write transaction modes, session characteristics, RESET ALL, DISCARD, transaction control, SET ROLE, SET SESSION AUTHORIZATION, and other out-of-transaction constructs, the read-only access mode is requested as part of BEGIN in query_database, count_rows, execute_explain and the custom tool executor, and default_transaction_read_only is re-applied when a connection returns to the pool with unconfirmable connections discarded. Upgrading stops further writes but does not reveal whether any occurred, so pgEdge explicitly requires reviewing database audit logs for unexpected DDL or DML issued through the MCP connection. The documented workaround is to grant the connecting role no write privileges; this is effective because every write path still goes through PostgreSQL's own permission check, but it also removes any legitimate write capability, and it does not repair the underlying guard logic. Details are in the advisory at https://github.com/pgEdge/pgedge-postgres-mcp/security/advisories/GHSA-j7mp-839j-jrm7, the fix PR at https://github.com/pgEdge/pgedge-postgres-mcp/pull/196, and the release at https://github.com/pgEdge/pgedge-postgres-mcp/releases/tag/v1.1.0.

Affected VersionsENISA

pgedge-postgres-mcp < 1.1.0

Affected Packages

euvd pgedge_postgres_mcp fix: 1.1.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The component is an MCP (Model Context Protocol) server that brokers SQL against PostgreSQL, so the root cause sits at the boundary between statement classification and the PostgreSQL wire protocol. Read detection in internal/tools/query_database.go used strings.HasPrefix against SELECT, WITH, TABLE and VALUES, so any statement that did not match that prefix - including a legitimate-looking read preceded by a leading comment - was routed to tx.Exec(ctx, sqlQuery) with no bind parameters. pgx falls back to the simple query protocol when no bind parameters are supplied, and that protocol accepts several semicolon-separated statements in a single message, so the caller could append SET TRANSACTION READ WRITE or COMMIT; BEGIN READ WRITE to escape the read-only transaction. The transaction guard matched only the literal strings TRANSACTION_READ_ONLY and DEFAULT_TRANSACTION_READ_ONLY and never checked READ WRITE or SESSION CHARACTERISTICS, and the read-only access mode was set with SET TRANSACTION READ ONLY as a separate statement after BEGIN (in query_database.go, count_rows.go, custom_tool.go and execute_explain.go), so the transaction was briefly writable and the mode could fail independently. A secondary layer failed at the pool: default_transaction_read_only was applied only at connection establishment, so a RESET ALL or DISCARD ALL issued by one caller persisted on the pooled connection for later callers and other tokens. The CVE is classified CWE-89 (SQL injection) while the vendor advisory describes the class as CWE-693 (protection mechanism failure); the practical framing is a read-only enforcement bypass via statement smuggling rather than classic injection into a value. A separate but related route through custom pl-do tool dollar-quote parameters is tracked as GHSA-r5pp-jx86-r6r9 and is not covered by this CVE.

Know when Pgedge Postgres Mcp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
vuln.today AI 8.1 HIGH

Network-reachable MCP tool with low complexity; PR:L because the caller needs tool access and a write-capable role; C:N as reads were already permitted, I:H/A:H from arbitrary DDL/DML.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Nov 12, 2026 - 18:18 EUVD
CVE Published
Nov 12, 2026 - 17:27 cve.org
HIGH 8.1

DescriptionCVE.org

pgEdge Postgres MCP Server enables SQL queries against PostgreSQL databases through Model Context Protocol compatible clients. Prior to 1.1.0, query_database on a read_only connection could send unrecognized statements through pgx Exec without bind parameters, selecting PostgreSQL's simple query protocol and allowing multiple semicolon-separated statements in one request. A caller could combine transaction or session state changes with database writes, and pooled session state could leave later calls writable, when the connecting role held write privileges. The flaw affected deployments relying on read_only as a safety boundary, could compromise integrity and availability, and did not add confidentiality impact beyond the reads already permitted by the connection. This issue is fixed in 1.1.0.

Technical POC Analysis

Classification note first, because the two labels in evidence disagree: the GHSA assigns CWE-693 (Protection Mechanism Failure); the CVE record carries CWE-89.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-126196 in pgEdge Postgres MCP Server (v1.0.0 and earlier) allows authenticated users with write-privileged database roles to bypass the documented read-only mode and modify or delete database objects, threatening data integrity and availability. While no public exploit code exists, this undermines a key security control that teams may rely on to safely expose database access, and leadership should prioritize remediation to prevent potential data loss or disruption.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: enforce database-level read-only privileges by revoking write permissions from all roles used by the MCP server; disable or restrict access to the query_database tool; monitor database logs for unauthorized write operations; limit network exposure of the MCP server to trusted networks only.

Threat Intelligence Overview

EPSS Score
0.4%
Top 62% exploitable
Prevalence
Low
niche emerging MCP server from a specialized vendor, limited production footprint
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy