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.6, 17.11, 16.15, 15.19, and 14.24 are affected.
Published: 2026-08-13
Score: 8.1 High
EPSS: < 1% Very Low
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 lines as psql commands through error injection. When a “COPY FROM STDIN” or "\copy FROM STDIN" command fails before the server indicates it is ready to receive rows, psql processes the in‑line data rows as commands. Thus, an attacker who can supply malicious data rows will have those rows executed as SQL commands, potentially modifying data or gaining further control. The flaw 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.6, 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 < 1%, indicating a very low exploitation probability, 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 likely attack vector involves a combination of local privilege escalation via misuse of the COPY command and accidental or intentional data injection; this is inferred from the description because the attacker must simultaneously control the server and the data rows.

Generated by OpenCVE AI on August 30, 2026 at 01:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade PostgreSQL to a patched version (18.6 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 30, 2026 at 01:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4740-1 postgresql-15 security update
Debian DSA Debian DSA DSA-6438-1 postgresql-17 security update
Ubuntu USN Ubuntu USN USN-8653-1 PostgreSQL vulnerabilities
History

Sat, 29 Aug 2026 23: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. 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.6, 17.11, 16.15, 15.19, and 14.24 are affected.

Wed, 19 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*

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-29T23:07:34.365Z

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 : Modified

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

Modified: 2026-08-29T23:17:21.723

Link: CVE-2026-6464

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-30T01:45:04Z

Weaknesses
  • CWE-829

    Inclusion of Functionality from Untrusted Control Sphere