← Vulnerability feed

Vulnerability record · CVE-2019-9193 · published 1 April 2019

CVE-2019-9193: PostgreSQL COPY TO/FROM PROGRAM OS Command Execution

Postgresql · Postgresql

PostgreSQL 9.3 through 11.2 enables the COPY TO/FROM PROGRAM feature by default, allowing superusers and members of the pg_execute_server_program group to run arbitrary operating system commands as the database server user. The record notes that third parties dispute this as a vulnerability, arguing the behavior is intended functionality, but the NVD entry and multiple advisories treat it as OS command injection.

7.2 CVSS 3.0 High EPSS 92% · top 0.2% CWE-78 · OS command injection
7.2CVSS 3.0 base score, v2 9.0
92%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
16References, 2 tagged exploit
17 Jun 2026Last modified by NVD

Description

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_server_program' group to execute arbitrary code in the context of the database's operating system user. This functionality is enabled by default and can be abused to run arbitrary operating system commands on Windows, Linux, and macOS. NOTE: Third parties claim/state this is not an issue because PostgreSQL functionality for ‘COPY TO/FROM PROGRAM’ is acting as intended. References state that in PostgreSQL, a superuser can execute commands as the server user without using the ‘COPY FROM PROGRAM’.

CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityThe flaw yields OS command execution with high confidentiality, integrity and availability impact, and EPSS is extremely high, though exploitation requires authenticated privileged database access.

What it is

PostgreSQL 9.3 through 11.2 enables the COPY TO/FROM PROGRAM feature by default, allowing superusers and members of the pg_execute_server_program group to run arbitrary operating system commands as the database server user. The record notes that third parties dispute this as a vulnerability, arguing the behavior is intended functionality, but the NVD entry and multiple advisories treat it as OS command injection.

Impact

An attacker with the required database privileges gains arbitrary command execution in the context of the PostgreSQL operating system user, which can lead to full compromise of the database host and any data or credentials it can reach.

Attack surface

Reachable over the network via the PostgreSQL protocol (CVSS vector AV:N) by an authenticated user holding superuser rights or membership in the pg_execute_server_program group; no user interaction is required.

Exploitation

Not listed in CISA KEV, but EPSS is very high (0.91655, 99.8th percentile) and public references include an exploit-tagged writeup, indicating active interest and available proof-of-concept material.

What to do

  • Upgrade PostgreSQL to a version after 11.2 where the record's affected range ends, or apply vendor guidance for your branch.
  • Revoke superuser and pg_execute_server_program membership from accounts that do not strictly require it.
  • Restrict network access to PostgreSQL to trusted hosts and require strong authentication.
  • Audit and monitor use of COPY ... PROGRAM in database logs and application code.
  • Where the feature is not needed, consider disabling or tightly controlling server-side program execution per vendor guidance.

Detection

  • Search PostgreSQL logs for COPY statements containing PROGRAM, especially with shell metacharacters or unusual commands.
  • Alert on new or changed membership in the pg_execute_server_program role and on superuser grants.
  • Monitor database server processes for unexpected child processes spawned by the postgres user.
  • Correlate database authentication events from unusual source IPs with subsequent OS command execution activity.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://packetstormsecurity.com/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html Third Party Advisory
http://packetstormsecurity.com/files/166540/PostgreSQL-11.7-Remote-Code-Execution.html
http://packetstormsecurity.com/files/171722/PostgreSQL-9.6.1-Remote-Code-Execution.html
https://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/ Third Party Advisory
https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5 ExploitThird Party Advisory
https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20190502-0003/ Third Party Advisory
https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql- Third Party Advisory
http://packetstormsecurity.com/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html Third Party Advisory
http://packetstormsecurity.com/files/166540/PostgreSQL-11.7-Remote-Code-Execution.html
http://packetstormsecurity.com/files/171722/PostgreSQL-9.6.1-Remote-Code-Execution.html
https://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/ Third Party Advisory
https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5 ExploitThird Party Advisory
https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/ Third Party Advisory
https://security.netapp.com/advisory/ntap-20190502-0003/ Third Party Advisory
https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql- Third Party Advisory

Track CVE-2019-9193 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2013-1902Postgresql vulnerabilityPostgreSQL, 9.2.x before 9.2.4, 9.1.x before 9.1.9, 9.0.x before 9.0.13, 8.4.x before 8.4.17, and 8.3.x before 8.3.23 generates insecure temporary fi…EPSS 2.2%10.0CVE-2013-1903Postgresql permissions and access controls vulnerabilityPostgreSQL, possibly 9.2.x before 9.2.4, 9.1.x before 9.1.9, 9.0.x before 9.0.13, 8.4.x before 8.4.17, and 8.3.x before 8.3.23 incorrectly provides t…EPSS 2.2%10.0CVE-2007-3279Postgresql vulnerabilityPostgreSQL 8.1 and probably later versions, when the PL/pgSQL (plpgsql) language has been created, grants certain plpgsql privileges to the PUBLIC do…EPSS 2.6%10.0CVE-2002-1399Postgresql vulnerabilityUnknown vulnerability in cash_out and possibly other functions in PostgreSQL 7.2.1 and earlier, and possibly later versions before 7.2.3, with unknow…EPSS 1.8%9.8CVE-2015-0244Postgresql sql injection vulnerabilityPostgreSQL before 9.0.19, 9.1.x before 9.1.15, 9.2.x before 9.2.10, 9.3.x before 9.3.6, and 9.4.x before 9.4.1 does not properly handle errors while …EPSS 4.4%9.8CVE-2015-3166Postgresql memory buffer overflow vulnerabilityThe snprintf implementation in PostgreSQL before 9.0.20, 9.1.x before 9.1.16, 9.2.x before 9.2.11, 9.3.x before 9.3.7, and 9.4.x before 9.4.2 does no…EPSS 4.6%9.8CVE-2019-10211Postgresql code injection vulnerabilityPostgresql Windows installer before versions 11.5, 10.10, 9.6.15, 9.5.19, 9.4.24 is vulnerable via bundled OpenSSL executing code from unprotected di…EPSS 1.8%9.8CVE-2018-16850Postgresql sql injection vulnerabilitypostgresql before versions 11.1, 10.6 is vulnerable to a to SQL injection in pg_upgrade and pg_dump via CREATE TRIGGER ... REFERENCING. Using a purpo…EPSS 5.1%

Source: NIST National Vulnerability Database (record CVE-2019-9193), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.