CVE-2026-87911: OS command injection bypasses read-only mode in postgres-mcp-server
AWS disclosed CVE-2026-87911, an OS command injection flaw in the SQL validation logic of awslabs.postgres-mcp-server before version 1.1.7. A crafted COPY ... TO PROGRAM statement can bypass the server's default read-only enforcement and execute OS commands on a self-managed PostgreSQL host when the connected database role holds superuser or pg_execute_server_program privileges. The issue is fixed in version 1.1.7 on PyPI.
SECURITY · DATA · CLOUD · VULNERABILITY · SECURITY ADVISORY
PUBLISHED SEP 13, 2026 00:49 UTC
WHAT CHANGED
The read-only validation logic in awslabs postgres-mcp-server failed to block COPY ... TO PROGRAM statements, allowing command execution on the underlying PostgreSQL host despite the server being configured in read-only mode. This affects self-managed PostgreSQL deployments using the PG_WIRE_PROTOCOL connection method where the configured role has superuser or pg_execute_server_program privileges. Version 1.1.7 addresses the issue.
WHY IT MATTERS
Administrators relying on the MCP server's read-only mode as a security boundary could have that boundary bypassed, resulting in arbitrary OS command execution on the database host if an overly privileged role is used. AWS recommends using a minimal-privilege dedicated Postgres role rather than superuser or cluster master accounts as defense in depth, since database-level privilege restriction remains effective even if application-level blocklisting is bypassed.
WHO IS AFFECTED
- PRODUCTS
- awslabs.postgres-mcp-server (Python package, PyPI)
- FEATURES
- SQL validation / read-only enforcement componentCOPY ... TO PROGRAM statement handling
- CONFIGURATIONS
- awslabs.postgres-mcp-server versions before 1.1.7Self-managed PostgreSQL deployment profile using the PG_WIRE_PROTOCOL connection methodConfigured database role holds superuser or pg_execute_server_program privilege
- ENVIRONMENTS
- Self-managed PostgreSQL
WHAT TO DO
- 01CRITICALAUTOMATABLE
Upgrade awslabs.postgres-mcp-server to version 1.1.7 or later via PyPI to remediate CVE-2026-87911.
- 02HIGH
Stop connecting the MCP server using superuser, rds_superuser, or the cluster master user role.
- 03HIGHAUTOMATABLE
Create a dedicated Postgres role for the MCP server and grant only CONNECT, USAGE, and SELECT on required schemas for read-only use, enforcing read-only transactions at the role level.
- 04MEDIUMAUTOMATABLE
For read/write use cases, grant only the specific INSERT/UPDATE/DELETE privileges required, scoped to necessary schemas and tables.
TIMELINE
- ANNOUNCED
- SEP 9, 2026
SOURCES
- PRIMARY SOURCEAMAZON WEB SERVICES
CVE-2026-87911 - Read-only enforcement bypass enabling operating system command execution in the SQL validation component of Amazon awslabs postgres-mcp-server
PUBLISHED SEP 9, 2026VIEW SOURCE
VERIFICATION
ShiftWire summarizes and analyzes changes from the cited sources. Always review the primary source before implementing material changes.