Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach MCP query channel (untrusted agent input)
-
DeliveryCraft SELECT with pg_read_file in FROM clause
-
ExploitRangeFunction node skips allowlist check
-
ExecutionPostgreSQL executes file-read function
-
ImpactExfiltrate arbitrary host file contents
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires that the target run Postgres MCP Pro 0.3.0 with restricted mode enabled (the very control being bypassed) and that the attacker can submit SQL query text to the MCP server, e.g. through an LLM agent exposed to untrusted input. The file-reading function (pg_read_file/pg_read_binary_file) must be invoked from a FROM clause as a RangeFunction rather than a SELECT target. Limiting factors: the PostgreSQL role used by the server must retain EXECUTE on those functions (default for superuser/pg_read_server_files members), and readable files are constrained to those accessible to the PostgreSQL service account; deployments that revoke these functions or that expose the MCP endpoint only to fully trusted callers are not practically exploitable. |
| Impact | The vendor CVSS 4.0 vector (9.2, AV:N/AC:L/PR:N/UI:N/VC:H/SC:H) reflects a network-reachable, low-complexity read of high-value data with a scope/subsequent-system impact on the underlying host filesystem, which is a credible characterization of a restricted-mode bypass. No EPSS score, KEV listing, or public PoC is present in the provided data, so this is a high-severity-by-design issue rather than a confirmed mass-exploited one; the risk is concentrated in deployments that actually rely on restricted mode to expose the MCP server to untrusted or semi-trusted input (for example, an LLM agent processing attacker-influenced prompts). The most important caveat is the trust model: PR:N is only fair if the query channel is meant to be reachable by low-privileged/untrusted callers - where restricted mode is used as the sole safety boundary, any operator, even a mid-sized municipal IT team running an internal agent, should treat this as urgent and stop trusting restricted mode until patched, whereas a purely single-tenant local deployment behind authentication faces lower exposure. Impact is read-only (VI/VA:N), so this is confidentiality-focused, not an integrity or availability event. |
| Exploit ScenarioDerived | An attacker who can influence queries sent to a restricted-mode Postgres MCP Pro 0.3.0 server - for example via prompt injection against an LLM agent wired to the tool - submits 'SELECT * FROM pg_read_file('/etc/passwd')' or reads database credentials, .pgpass, or configuration files. Because RangeFunction nodes skip the allowlist check, the query executes and returns the file contents. No authenticated PostgreSQL session or user interaction beyond the query channel is required. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 04, 2026
Arbitrary file read in Postgres MCP Pro 0.3.0 (crystaldba/postgres-mcp) lets attackers bypass restricted-mode SQL safeguards by invoking file-reading functions such as pg_read_file inside FROM-clause RangeFunction nodes, which the function-name allowlist fails to inspect. Any client able to submit queries to the MCP server can therefore read files accessible to the PostgreSQL service account despite the tool's safety controls. No public exploit identified at time of analysis, and the flaw is not in CISA KEV; the technique is described in a VulnCheck advisory and GitHub issue #178.
RemediationAI
No vendor-released patch version is identified in the available data - the references point to the project repository and an open GitHub issue (#178), not to a tagged fixed release, so upgrade guidance cannot cite a confirmed version; monitor https://github.com/crystaldba/postgres-mcp for a release that extends function-name validation to RangeFunction/FROM-clause nodes. As compensating controls: do not treat restricted mode as a sufficient boundary for untrusted input on 0.3.0; run the MCP server against a PostgreSQL role with least privilege and explicitly REVOKE EXECUTE on pg_read_file, pg_read_binary_file, pg_ls_dir and related filesystem/administrative functions (trade-off: breaks any legitimate feature relying on them); restrict network access to the MCP endpoint to trusted clients only (trade-off: reduces the untrusted-agent use case restricted mode was meant to enable); and run PostgreSQL under an OS account with minimal filesystem access so pg_read_file cannot reach sensitive files (trade-off: may limit legitimate COPY/import workflows). Review the VulnCheck advisory for authoritative guidance.
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
Postgres MCP Pro is a Model Context Protocol (MCP) server that brokers SQL access to a PostgreSQL database, typically for LLM-driven agents, and offers a 'restricted mode' meant to constrain what queries untrusted callers can run. The restriction is enforced in src/postgres_mcp/sql/safe_sql.py by parsing SQL and validating function names against an allowlist, but the parser walks only certain node types and does not apply function-name validation to RangeFunction nodes - the AST construct representing set-returning/table functions used in a FROM clause. This is a classic CWE-863 (Improper Authorization) gap: the authorization check exists but is not consistently applied across all code paths, so functions blocked in a SELECT target list (e.g. pg_read_file, pg_read_binary_file) pass validation when expressed as 'SELECT * FROM pg_read_file(...)'. The affected package is identified by CPE cpe:2.3:a:crystaldba:postgres-mcp:*:*:*:*:*:*:*:* at version 0.3.0.
Know when 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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
Restricted mode is designed to gate untrusted query input, so PR:N is defensible; bypassing that authority to read host files is a scope change (S:C) with confidentiality-only impact (C:H, I/A:N).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
Postgres MCP Pro 0.3.0 contains a restricted-mode bypass vulnerability where function-name validation is not applied to RangeFunction nodes in FROM clauses. Attackers can execute file-reading functions like pg_read_file through FROM-clause syntax to read arbitrary files despite restricted-mode protections.
Articles & Coverage 2
Executive ViewAI
Postgres MCP Pro 0.3.0 contains an arbitrary file read vulnerability that allows attackers with query access to the MCP server to bypass the tool's built-in safety controls and read sensitive files from the database server host, including credentials, configuration files, and application data. Organizations using this tool face immediate risk of credential compromise and data exposure.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict MCP server network access via firewall to whitelisted trusted hosts; (2) Require multi-factor authentication for all MCP client connections; (3) Run the PostgreSQL service account with minimal filesystem permissions to limit readable files; (4) Enable database audit logging and file-access monitoring; (5) Isolate the MCP server on a segmented network with no internet egress; (6) Monitor query logs for suspicious FROM-clause function invocations. Plan immediate tool replacement as primary remediation.
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
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
EUVD-2026-71227
GHSA-cm87-gp55-7cgj
NVD
CVE.org
EPSS
Exploit-DB