Sceawere
Vulnerability Detail
CVE-2026-6464UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
PostgreSQL psql COPY Error Injection Command Execution
Vulnerability Metadata
- Severity
- High
- Score / CVSS
- 8.1
- Creation Date
- 8h ago
- Vendor
- n/a
- Product
- PostgreSQL
- Attack Type
- Inclusion of Functionality from Untrusted Control Sphere
- Vector String
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Complexity
- HIGH
Narrative and Response
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.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "8.1",
"pubDate": "2026-08-13T13:19:16.347Z",
"pubdate": "2026-08-13T13:19:16.347Z",
"executiveSummary": "An untrusted data inclusion vulnerability exists in the PostgreSQL psql utility related to the processing of COPY FROM STDIN and \\copy FROM STDIN commands. This vulnerability allows the execution of arbitrary data lines as psql commands via error injection if the command fails prior to the server indicating readiness to accept input rows. The vulnerability impacts PostgreSQL versions prior to 18.5, 17.11, 16.15, 15.19, and 14.24. Operations using COPY FROM with a specified filename remain unaffected. Risk implications involve potential arbitrary command execution within the context of the psql client session. Exploitation requires specific preconditions: a complete attack necessitates that an attacker separately acquires control of both the PostgreSQL server and the inline data rows, or alternatively, an attacker controlling solely the data rows might succeed if a coincidental server-side error occurs independently of their direct control.",
"technicalDetails": "The vulnerability resides within the psql client component of PostgreSQL, specifically in how it handles input state transitions during COPY FROM STDIN and \\copy FROM STDIN operations. The root cause is improper state management and error handling within the client-side parser when an error condition occurs during the initialization phase of the COPY transaction—specifically before the backend server signals that it is actively awaiting data rows. Under these precise failure conditions, the psql client fails to properly discard or ignore subsequent input streams, causing it to misinterpret in-line data rows as interactive psql client commands rather than raw database tuples. Regarding attack flow and exploitation mechanics: 1) The client initiates a COPY FROM STDIN or \\copy FROM STDIN command. 2) An error is injected or triggered on the server side before the server enters the COPY input state. 3) Due to the premature failure, psql drops out of the COPY data transfer parser mode while still consuming the subsequent lines from the data stream. 4) The client sequentially processes these raw data lines as executable psql commands instead of treating them as literal input data. Authentication and privilege requirements vary based on the vector; a comprehensive attack mandates that the malicious actor controls both the server infrastructure and the injected data payload, or alternatively, an attacker controlling only the data rows can leverage an uncontrolled, coincidental server error to trigger the parser misbehavior. The payload behavior consists of arbitrary psql meta-commands or SQL statements parsed directly from the data stream. Post-exploitation impact includes the unauthorized execution of commands within the local security context of the user running the psql session."
}