Description
Untrusted data inclusion in PostgreSQL psql COPY may allow a server administrator to elicit execution of data lines as psql commands, via error injection. If the "COPY FROM STDIN" or "\copy FROM STDIN" command fails before the server indicates that it awaits input rows, psql processes the in-line data rows as psql commands. "COPY FROM" with a filename is unaffected. The server administrator has no inherent control over the data rows, so a complete attack requires the attacker to separately acquire control of both the server and the data rows. Alternatively, an attacker controlling data rows alone might complete an attack through a coincidental error that they don't control. Versions before PostgreSQL 18.5, 17.11, 16.15, 15.19, and 14.24 are affected.
Published: 2026-08-13
Score: 8.1 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Untrusted data inclusion in PostgreSQL psql COPY allows a server administrator to trigger execution of data rows as psql commands after a failed COPY FROM STDIN operation. The flaw occurs when the command fails before the server signals readiness to receive rows, causing psql to interpret those rows as commands. As a result, an attacker who can supply malicious data rows can have those rows executed as SQL commands, potentially modifying data or gaining further control. The vulnerability stems from improper handling of input data and is classified as CWE‑829.

Affected Systems

This issue affects PostgreSQL servers running any version prior to 18.5, 17.11, 16.15, 15.19, or 14.24. The product is the PostgreSQL database engine, and the affected components are the psql client handling COPY FROM STDIN operations.

Risk and Exploitability

The CVSS score of 8.1 indicates high severity, but the exploitability is limited because the attacker must control both the PostgreSQL server with sufficient privileges to run COPY and the data rows that will be interpreted as commands. The EPSS score is unavailable, and the vulnerability is not listed in CISA’s KEV catalog. Assuming an attacker can achieve the required conditions, they could inject arbitrary SQL, leading to high impact on confidentiality, integrity, and availability. The attack vector is essentially a combination of local privilege escalation via COPY command misuse and data injection.

Generated by OpenCVE AI on August 13, 2026 at 15:01 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade PostgreSQL to a patched version (18.5 or later for PostgreSQL 18, 17.11 or later for 17, 16.15 or later for 16, 15.19 or later for 15, and 14.24 or later for 14).
  • Limit the use of COPY FROM STDIN to trusted contexts and consider using COPY with a filename instead, which is unaffected by this flaw.
  • Validate or sanitize any data rows before they are supplied to COPY FROM STDIN to prevent unintended command execution.

Generated by OpenCVE AI on August 13, 2026 at 15:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DSA Debian DSA DSA-6438-1 postgresql-17 security update
History

Thu, 13 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 13 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
First Time appeared Postgresql
Postgresql postgresql
Vendors & Products Postgresql
Postgresql postgresql

Thu, 13 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
Description Untrusted data inclusion in PostgreSQL psql COPY may allow a server administrator to elicit execution of data lines as psql commands, via error injection. If the "COPY FROM STDIN" or "\copy FROM STDIN" command fails before the server indicates that it awaits input rows, psql processes the in-line data rows as psql commands. "COPY FROM" with a filename is unaffected. The server administrator has no inherent control over the data rows, so a complete attack requires the attacker to separately acquire control of both the server and the data rows. Alternatively, an attacker controlling data rows alone might complete an attack through a coincidental error that they don't control. Versions before PostgreSQL 18.5, 17.11, 16.15, 15.19, and 14.24 are affected.
Title PostgreSQL psql COPY FROM STDIN early failure processes data lines as psql commands
Weaknesses CWE-829
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

Postgresql Postgresql
cve-icon MITRE

Status: PUBLISHED

Assigner: PostgreSQL

Published:

Updated: 2026-08-13T15:39:45.581Z

Reserved: 2026-04-17T00:19:12.645Z

Link: CVE-2026-6464

cve-icon Vulnrichment

Updated: 2026-08-13T15:39:40.614Z

cve-icon NVD

Status : Received

Published: 2026-08-13T13:19:16.347

Modified: 2026-08-13T16:18:56.653

Link: CVE-2026-6464

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T15:15:13Z

Weaknesses
  • CWE-829

    Inclusion of Functionality from Untrusted Control Sphere