CVE-2026-6464
PostgreSQL vulnerability analysis and mitigation

Overview

CVE-2026-6464 is a vulnerability in the PostgreSQL psql client's COPY FROM STDIN command that allows untrusted data rows to be executed as psql commands via error injection. When a COPY FROM STDIN or \copy FROM STDIN command fails before the server signals readiness for input rows, psql incorrectly processes the inline data rows as psql commands rather than data. Affected versions include PostgreSQL 14.x before 14.24, 15.x before 15.19, 16.x before 16.15, 17.x before 17.11, and 18.x before 18.5. The vulnerability carries a CVSS v3.1 base score of 8.1 (High) (PostgreSQL Advisory).

Technical details

The root cause is classified as CWE-829 (Inclusion of Functionality from Untrusted Control Sphere): when a COPY FROM STDIN operation encounters a server-side error before the server enters data-receive mode, the psql client falls through to interpreting the pending inline data rows as interactive psql meta-commands or SQL statements. COPY FROM with a filename is not affected because the data path differs. A complete attack requires an adversary to control both the PostgreSQL server (to trigger the error condition) and the data rows being copied; alternatively, an attacker controlling only the data rows could exploit a coincidental, uncontrolled server error to achieve the same effect (PostgreSQL Advisory).

Impact

Successful exploitation can result in arbitrary psql command execution in the context of the connecting client, leading to high confidentiality, integrity, and availability impact. An attacker could read or modify database contents, execute server-side commands via psql meta-commands (e.g., \!), or disrupt database availability. Because the attack is network-reachable and requires no authentication on its own (though it does require control of the server or data rows), the potential blast radius includes any system or data accessible to the psql session (PostgreSQL Advisory).

Exploitability

As of the time of publication, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (PostgreSQL Advisory). The EPSS score is approximately 0.49%, reflecting low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation is rated as non-automatable by NVD SSVC analysis, given the requirement to control both the server and data rows (or rely on a coincidental error).

Exploitation steps

  1. Gain server control: Obtain administrative or sufficient access to a vulnerable PostgreSQL server (versions before 18.5, 17.11, 16.15, 15.19, or 14.24) to craft or influence server behavior.
  2. Prepare malicious data rows: Construct a data payload intended for a COPY FROM STDIN operation where the inline data rows contain valid psql meta-commands (e.g., \! id or \copy ... to ...) that would be harmful if executed as commands.
  3. Trigger a pre-input error: Arrange for the COPY FROM STDIN or \copy FROM STDIN command to fail on the server side before the server sends the signal indicating it is ready to receive input rows (e.g., by causing a permission error, constraint violation at parse time, or other server-side rejection).
  4. Exploit psql command processing: Because the server error occurs before the data-receive phase, the psql client processes the pending inline data rows as psql commands rather than discarding them as data, executing the attacker-controlled payload.
  5. Achieve objective: The executed psql commands can read/write data, invoke shell commands via \!, or perform other privileged actions within the psql session's permission scope (PostgreSQL Advisory).

Indicators of compromise

  • Logs: PostgreSQL server logs showing COPY FROM STDIN commands that result in early errors (before the stdin data phase), particularly from unexpected client IPs or service accounts.
  • Logs: psql client-side audit logs or application logs showing unexpected psql meta-command execution (e.g., \!, \copy, \o) immediately following a failed COPY FROM STDIN statement.
  • Process: Unexpected child processes spawned by the psql client process (e.g., shell commands invoked via \!) on the host running the psql client.
  • Network: Unusual or repeated COPY FROM STDIN connection attempts to PostgreSQL servers from external or untrusted network sources.

Mitigation and workarounds

Upgrade PostgreSQL to the patched versions: 18.5, 17.11, 16.15, 15.19, or 14.24 (PostgreSQL Advisory, PostgreSQL Release). As interim mitigations, restrict network access to PostgreSQL servers using firewalls or pg_hba.conf rules, and limit which users or applications are permitted to execute COPY FROM STDIN operations. Monitor for suspicious COPY FROM STDIN usage patterns that result in server errors, and audit psql client environments for unexpected command execution.

Community reactions

The PostgreSQL project disclosed the vulnerability alongside a coordinated release of patched versions on August 13, 2026 (PostgreSQL Release). Downstream Linux distributions including Debian and Ubuntu issued security advisories and package updates shortly after (Ubuntu Advisory). Security scanning vendors including Tenable/Nessus added detection plugins for the vulnerability. Community commentary noted that the attack complexity is high due to the dual-control requirement, limiting immediate risk for most deployments.

Additional resources


SourceThis report was generated using AI

Related PostgreSQL vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-6464HIGH8.1
  • PostgreSQL logoPostgreSQL
  • cpe:2.3:a:postgresql:postgresql
NoYesAug 13, 2026
CVE-2026-73515HIGH7.2
  • PostgreSQL logoPostgreSQL
  • postgis-client
NoYesAug 13, 2026
CVE-2026-6471HIGH7.2
  • PostgreSQL logoPostgreSQL
  • postgresql-17
NoYesAug 13, 2026
CVE-2026-6470MEDIUM4.3
  • PostgreSQL logoPostgreSQL
  • cpe:2.3:a:postgresql:postgresql
NoYesAug 13, 2026
CVE-2026-6469LOW3.8
  • PostgreSQL logoPostgreSQL
  • postgresql-13
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management