CVE-2019-9193

HIGH EXPLOITED IN THE WILD NUCLEI

PostgreSQL 9.3-11.2 - Authenticated OS Command Injection via COPY TO/FROM PROGRAM

Title source: llm
STIX 2.1

Exploitation Summary

CVE-2019-9193 has been observed exploited in the wild (reported by VulnCheck KEV, InTheWild.io). EIP tracks 13 public exploits from researchers including Metasploit, Paulo Trindade, b4keSn4ke, including a Metasploit module exploits/multi/postgres/postgres_copy_from_program_cmd_exec. A Nuclei detection template is also available.

AI-analyzed exploit summary This Metasploit module exploits CVE-2019-9193 by leveraging PostgreSQL's COPY FROM PROGRAM functionality to execute arbitrary commands. It creates a table, copies command output into it, and supports multiple platforms (Unix, Windows, OSX).

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’.

Exploits (13)

exploitdb WORKING POC VERIFIED
by Metasploit · rubyremotemultiple
https://www.exploit-db.com/exploits/46813

This Metasploit module exploits CVE-2019-9193 by leveraging PostgreSQL's COPY FROM PROGRAM functionality to execute arbitrary commands. It creates a table, copies command output into it, and supports multiple platforms (Unix, Windows, OSX).

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.3 and above
Auth required
Prerequisites: Valid PostgreSQL credentials · Superuser or pg_execute_server_program privilege
devstral-2 · analyzed Feb 18, 2026 Full analysis →
exploitdb WORKING POC
by Paulo Trindade · pythonremotemultiple
https://www.exploit-db.com/exploits/51247

This exploit leverages PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands via a trigger-based payload. It requires authentication and demonstrates RCE by creating a table, function, and trigger to execute the provided command.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.6.1
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server
devstral-2 · analyzed Feb 18, 2026 Full analysis →
exploitdb WORKING POC
by b4keSn4ke · pythonremotemultiple
https://www.exploit-db.com/exploits/50847

This exploit leverages PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands via authenticated SQL queries. It creates a temporary table, executes the command, and retrieves the output, demonstrating RCE in PostgreSQL versions 9.3-11.7.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3-11.7
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 20 stars
by b4keSn4ke · remote-auth
https://github.com/b4keSn4ke/CVE-2019-9193

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands. It requires authentication and creates a temporary table to capture command output.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3-12.3
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server · PostgreSQL server with COPY FROM PROGRAM enabled
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 4 stars
by geniuszly · remote-auth
https://github.com/geniuszly/CVE-2019-9193

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands on vulnerable versions (9.3-11.7). It includes version checking, temporary table management, and command execution via authenticated PostgreSQL sessions.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3-11.7
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to PostgreSQL server · PostgreSQL version 9.3-11.7
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 3 stars
by wkjung0624 · remote
https://github.com/wkjung0624/cve-2019-9193

This PoC exploits CVE-2019-9193 in PostgreSQL by leveraging the 'COPY TO/FROM PROGRAM' feature to execute arbitrary commands, establishing a reverse shell. It requires superuser or 'pg_execute_server_program' privileges.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL (versions affected by CVE-2019-9193)
Auth required
Prerequisites: Superuser or 'pg_execute_server_program' privileges in PostgreSQL · Network connectivity to the target PostgreSQL server
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 1 stars
by paulotrindadec · remote-auth
https://github.com/paulotrindadec/CVE-2019-9193

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands via a trigger. It requires authentication and demonstrates RCE by creating a table, function, and trigger to execute the provided command.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.6.1
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server · Sufficient privileges to create tables, functions, and triggers
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by CybersRMUTL · remote-auth
https://github.com/CybersRMUTL/CVE-2019-9193-Postgresql-RCE

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands. It requires authentication and targets PostgreSQL versions 9.3 to 11.7.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3-11.7
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by netw0rk7 · poc
https://github.com/netw0rk7/CVE-2019-9193-Home-Lab

This repository provides a functional proof-of-concept for CVE-2019-9193, demonstrating how PostgreSQL's COPY FROM PROGRAM feature can be exploited for remote command execution (RCE) by superusers or users with the pg_execute_server_program role. The lab includes a Dockerized environment and step-by-step instructions to read a flag file via OS command injection.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3-11.2
Auth required
Prerequisites: PostgreSQL superuser access or pg_execute_server_program role · Network access to PostgreSQL port
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by corsisechero · remote-auth
https://github.com/corsisechero/CVE-2019-9193byVulHub

This repository provides a working proof-of-concept for CVE-2019-9193, a PostgreSQL vulnerability allowing arbitrary command execution via the COPY FROM PROGRAM feature. It includes setup instructions and exploit steps for versions 9.3 to 11.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: PostgreSQL 9.3 to 11
Auth required
Prerequisites: PostgreSQL admin privileges or COPY TO/FROM PROGRAM privileges · Access to PostgreSQL client (psql)
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by jhnhnck · poc
https://github.com/jhnhnck/CVE-2019-9193

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary system commands on vulnerable PostgreSQL servers (9.3-11.7). It includes version checking and automated table management for command execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.3-11.7
Auth required
Prerequisites: Authenticated PostgreSQL access · PostgreSQL server with COPY FROM PROGRAM enabled
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by chromanite · remote-auth
https://github.com/chromanite/CVE-2019-9193-PostgreSQL-9.3-11.7

This is a functional exploit for CVE-2019-9193, leveraging PostgreSQL's COPY FROM PROGRAM feature to execute arbitrary commands on the server. It establishes an authenticated connection and provides a pseudo-shell for command execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.3-11.7
Auth required
Prerequisites: Valid PostgreSQL credentials · Network access to the PostgreSQL server · PostgreSQL version between 9.3 and 11.7
devstral-2 · analyzed Feb 16, 2026 Full analysis →
metasploit WORKING POC EXCELLENT
by Jacob Wilkin · rubypocunix
https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb

This Metasploit module exploits PostgreSQL's COPY FROM PROGRAM functionality to execute arbitrary commands via authenticated SQL queries. It creates a table, executes a payload via COPY, and optionally dumps output for debugging.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 9.3 and above
Auth required
Prerequisites: Valid PostgreSQL credentials · Superuser or pg_execute_server_program privilege
devstral-2 · analyzed Feb 16, 2026 Full analysis →

Nuclei Templates (1)

PostgreSQL 9.3-12.3 Authenticated Remote Code Execution
HIGHVERIFIEDby pussycat0x
Shodan: product:"PostgreSQL"

Scores

CVSS v3 7.2
EPSS 0.9365
EPSS Percentile 99.9%
Attack Vector NETWORK
CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact total

Details

VulnCheck KEV 2021-01-22
InTheWild.io 2020-04-07
CWE
CWE-78
Status published
Products (1)
postgresql/postgresql 9.3 - 11.2
Published Apr 01, 2019
Tracked Since Feb 18, 2026