CVEdetails.com the ultimate security vulnerability data source
(e.g.: CVE-2009-1234 or 2010-1234 or 20101234)
Log In   Register
Vulnerability Feeds & WidgetsNew   www.itsecdb.com  

Vulnerability Details : CVE-2019-9193

** DISPUTED ** In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_read_server_files' 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?. Furthermore, members in 'pg_read_server_files' can run commands only if either the 'pg_execute_server_program' role or superuser are granted.
Publish Date : 2019-04-01 Last Update Date : 2019-05-13
Search Twitter   Search YouTube   Search Google

- CVSS Scores & Vulnerability Types

CVSS Score
9.0
Confidentiality Impact Complete (There is total information disclosure, resulting in all system files being revealed.)
Integrity Impact Complete (There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the entire system being compromised.)
Availability Impact Complete (There is a total shutdown of the affected resource. The attacker can render the resource completely unavailable.)
Access Complexity Low (Specialized access conditions or extenuating circumstances do not exist. Very little knowledge or skill is required to exploit. )
Authentication Single system (The vulnerability requires an attacker to be logged into the system (such as at a command line or via a desktop session or web interface).)
Gained Access None
Vulnerability Type(s) Execute Code
CWE ID 78

- Products Affected By CVE-2019-9193

# Product Type Vendor Product Version Update Edition Language
1 Application Postgresql Postgresql 9.3 Version Details Vulnerabilities
2 Application Postgresql Postgresql 9.3.0 Version Details Vulnerabilities
3 Application Postgresql Postgresql 9.3.1 Version Details Vulnerabilities
4 Application Postgresql Postgresql 9.3.2 Version Details Vulnerabilities
5 Application Postgresql Postgresql 9.3.3 Version Details Vulnerabilities
6 Application Postgresql Postgresql 9.3.4 Version Details Vulnerabilities
7 Application Postgresql Postgresql 9.3.5 Version Details Vulnerabilities
8 Application Postgresql Postgresql 9.3.6 Version Details Vulnerabilities
9 Application Postgresql Postgresql 9.3.7 Version Details Vulnerabilities
10 Application Postgresql Postgresql 9.3.8 Version Details Vulnerabilities
11 Application Postgresql Postgresql 9.3.9 Version Details Vulnerabilities
12 Application Postgresql Postgresql 9.3.10 Version Details Vulnerabilities
13 Application Postgresql Postgresql 9.3.11 Version Details Vulnerabilities
14 Application Postgresql Postgresql 9.3.12 Version Details Vulnerabilities
15 Application Postgresql Postgresql 9.3.13 Version Details Vulnerabilities
16 Application Postgresql Postgresql 9.3.14 Version Details Vulnerabilities
17 Application Postgresql Postgresql 9.3.15 Version Details Vulnerabilities
18 Application Postgresql Postgresql 9.3.16 Version Details Vulnerabilities
19 Application Postgresql Postgresql 9.3.17 Version Details Vulnerabilities
20 Application Postgresql Postgresql 9.3.18 Version Details Vulnerabilities
21 Application Postgresql Postgresql 9.3.19 Version Details Vulnerabilities
22 Application Postgresql Postgresql 9.3.20 Version Details Vulnerabilities
23 Application Postgresql Postgresql 9.3.21 Version Details Vulnerabilities
24 Application Postgresql Postgresql 9.3.22 Version Details Vulnerabilities
25 Application Postgresql Postgresql 9.3.23 Version Details Vulnerabilities
26 Application Postgresql Postgresql 9.3.24 Version Details Vulnerabilities
27 Application Postgresql Postgresql 9.3.25 Version Details Vulnerabilities
28 Application Postgresql Postgresql 9.4 Version Details Vulnerabilities
29 Application Postgresql Postgresql 9.4.0 Version Details Vulnerabilities
30 Application Postgresql Postgresql 9.4.1 Version Details Vulnerabilities
31 Application Postgresql Postgresql 9.4.2 Version Details Vulnerabilities
32 Application Postgresql Postgresql 9.4.3 Version Details Vulnerabilities
33 Application Postgresql Postgresql 9.4.4 Version Details Vulnerabilities
34 Application Postgresql Postgresql 9.4.5 Version Details Vulnerabilities
35 Application Postgresql Postgresql 9.4.6 Version Details Vulnerabilities
36 Application Postgresql Postgresql 9.4.7 Version Details Vulnerabilities
37 Application Postgresql Postgresql 9.4.8 Version Details Vulnerabilities
38 Application Postgresql Postgresql 9.4.9 Version Details Vulnerabilities
39 Application Postgresql Postgresql 9.4.10 Version Details Vulnerabilities
40 Application Postgresql Postgresql 9.4.11 Version Details Vulnerabilities
41 Application Postgresql Postgresql 9.4.12 Version Details Vulnerabilities
42 Application Postgresql Postgresql 9.4.13 Version Details Vulnerabilities
43 Application Postgresql Postgresql 9.4.14 Version Details Vulnerabilities
44 Application Postgresql Postgresql 9.4.15 Version Details Vulnerabilities
45 Application Postgresql Postgresql 9.4.16 Version Details Vulnerabilities
46 Application Postgresql Postgresql 9.4.17 Version Details Vulnerabilities
47 Application Postgresql Postgresql 9.4.18 Version Details Vulnerabilities
48 Application Postgresql Postgresql 9.4.19 Version Details Vulnerabilities
49 Application Postgresql Postgresql 9.4.20 Version Details Vulnerabilities
50 Application Postgresql Postgresql 9.4.21 Version Details Vulnerabilities
51 Application Postgresql Postgresql 9.5 Version Details Vulnerabilities
52 Application Postgresql Postgresql 9.5.0 Version Details Vulnerabilities
53 Application Postgresql Postgresql 9.5.1 Version Details Vulnerabilities
54 Application Postgresql Postgresql 9.5.2 Version Details Vulnerabilities
55 Application Postgresql Postgresql 9.5.3 Version Details Vulnerabilities
56 Application Postgresql Postgresql 9.5.4 Version Details Vulnerabilities
57 Application Postgresql Postgresql 9.5.5 Version Details Vulnerabilities
58 Application Postgresql Postgresql 9.5.6 Version Details Vulnerabilities
59 Application Postgresql Postgresql 9.5.7 Version Details Vulnerabilities
60 Application Postgresql Postgresql 9.5.8 Version Details Vulnerabilities
61 Application Postgresql Postgresql 9.5.9 Version Details Vulnerabilities
62 Application Postgresql Postgresql 9.5.10 Version Details Vulnerabilities
63 Application Postgresql Postgresql 9.5.11 Version Details Vulnerabilities
64 Application Postgresql Postgresql 9.5.12 Version Details Vulnerabilities
65 Application Postgresql Postgresql 9.5.13 Version Details Vulnerabilities
66 Application Postgresql Postgresql 9.5.14 Version Details Vulnerabilities
67 Application Postgresql Postgresql 9.5.15 Version Details Vulnerabilities
68 Application Postgresql Postgresql 9.5.16 Version Details Vulnerabilities
69 Application Postgresql Postgresql 9.6 Version Details Vulnerabilities
70 Application Postgresql Postgresql 9.6.0 Version Details Vulnerabilities
71 Application Postgresql Postgresql 9.6.1 Version Details Vulnerabilities
72 Application Postgresql Postgresql 9.6.2 Version Details Vulnerabilities
73 Application Postgresql Postgresql 9.6.3 Version Details Vulnerabilities
74 Application Postgresql Postgresql 9.6.4 Version Details Vulnerabilities
75 Application Postgresql Postgresql 9.6.5 Version Details Vulnerabilities
76 Application Postgresql Postgresql 9.6.6 Version Details Vulnerabilities
77 Application Postgresql Postgresql 9.6.7 Version Details Vulnerabilities
78 Application Postgresql Postgresql 9.6.8 Version Details Vulnerabilities
79 Application Postgresql Postgresql 9.6.9 Version Details Vulnerabilities
80 Application Postgresql Postgresql 9.6.10 Version Details Vulnerabilities
81 Application Postgresql Postgresql 9.6.11 Version Details Vulnerabilities
82 Application Postgresql Postgresql 9.6.12 Version Details Vulnerabilities
83 Application Postgresql Postgresql 10.0 Version Details Vulnerabilities
84 Application Postgresql Postgresql 10.1 Version Details Vulnerabilities
85 Application Postgresql Postgresql 10.2 Version Details Vulnerabilities
86 Application Postgresql Postgresql 10.3 Version Details Vulnerabilities
87 Application Postgresql Postgresql 10.4 Version Details Vulnerabilities
88 Application Postgresql Postgresql 10.5 Version Details Vulnerabilities
89 Application Postgresql Postgresql 10.6 Version Details Vulnerabilities
90 Application Postgresql Postgresql 10.7 Version Details Vulnerabilities
91 Application Postgresql Postgresql 11.0 Version Details Vulnerabilities
92 Application Postgresql Postgresql 11.1 Version Details Vulnerabilities
93 Application Postgresql Postgresql 11.2 Version Details Vulnerabilities

- Number Of Affected Versions By Product

Vendor Product Vulnerable Versions
Postgresql Postgresql 93

- References For CVE-2019-9193

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

- Metasploit Modules Related To CVE-2019-9193

PostgreSQL COPY FROM PROGRAM Command Execution
Installations running Postgres 9.3 and above have functionality which allows for the superuser and users with 'pg_execute_server_program' to pipe to and from an external program using COPY. This allows arbitrary command execution as though you have console access. This module attempts to create a new table, then execute system commands in the context of copying the command output into the table. This module should work on all Postgres systems running version 9.3 and above. For Linux & OSX systems, target 1 is used with cmd payloads such as: cmd/unix/reverse_perl For Windows Systems, target 2 is used with powershell payloads such as: cmd/windows/powershell_reverse_tcp Alternativly target 3 can be used to execute generic commands, such as a web_delivery meterpreter powershell payload or other customised command.
Module type : exploit Rank : excellent Platforms : Linux,Unix,Windows,OSX


CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site. OVAL is a registered trademark of The MITRE Corporation and the authoritative source of OVAL content is MITRE's OVAL web site.
Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.