CVE-2019-9193 in the critical feed json
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…
published 7y ago modified 4mo ago also EUVD-2019-18570
- cvss
- 7.2
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 91.7%
- EPSS 91.7% chance of exploitation in 30 days, percentile 99.8%
- public exploits
- 4
- Metasploit and Exploit-DB, plus a Nuclei check
Summary
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’.
Is CVE-2019-9193 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2019-9193 updated cvss 0.0
postgresql: Command injection via "COPY TO/FROM PROGRAM" function
-
Red Hat CloudForms Management Engine 5 postgresql96, postgresql96-libs, postgresql96-test, postgresql96-pltcl, postgresql96-plperl, postgresql96-server, +2 more Red Hat Ansible Tower 3 postgresql96-libs Red Hat Enterprise Linux 5 postgresql Red Hat Enterprise Linux 6 postgresql, postgresql-libs, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, +2 more Red Hat Enterprise Linux 7 postgresql, postgresql-libs, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, +3 more Red Hat Enterprise Linux 8 libpq, pgaudit, pg_repack, postgresql, postgresql-test, postgresql-pltcl, +8 morenot affected: vulnerable code not present
+2 more productsfewer
Red Hat Satellite 5 rh-postgresql95-postgresql Red Hat Software Collections rh-postgresql10-postgresql, rh-postgresql95-postgresql, rh-postgresql96-postgresql, rh-postgresql10-postgresql-libs, rh-postgresql10-postgresql-test, rh-postgresql95-postgresql-libs, +24 more
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Timeline
- First public exploit (Metasploit exploit/multi/postgres/postgres_copy_from_program_cmd_exec)
- Published
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2y ago
Exploit prediction
91.66% chance of exploitation in the next 30 days, higher than 99.8% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- Metasploit exploit/multi/postgres/postgres_copy_from_program_cmd_exec PostgreSQL COPY FROM PROGRAM Command Execution metasploit exploit, excellent rank, 2019-03-20
- EDB-51247 PostgreSQL 9.6.1 - Remote Code Execution (RCE) (Authenticated) remote, 2023-04-05
- EDB-50847 PostgreSQL 9.3-11.7 - Remote Code Execution (RCE) (Authenticated) remote, 2022-03-30
- EDB-46813 PostgreSQL 9.3 - COPY FROM PROGRAM Command Execution (Metasploit) remote, 2019-05-08
- Nuclei template PostgreSQL 9.3-12.3 Authenticated Remote Code Execution nuclei detection template
- medium.com https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 7.2 | CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 9.0 | AV:N/AC:L/Au:S/C:C/I:C/A:C |
Classification
- Weakness
-
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
- Technology feeds
References
-
medium.com
/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5
exploit, third-party-advisory
-
paquier.xyz
/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/
third-party-advisory
-
blog.hagander.net
/when-a-vulnerability-is-not-a-vulnerability-244/
third-party-advisory
-
trustwave.com
/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/
third-party-advisory
-
security.netapp.com
/advisory/ntap-20190502-0003/
third-party-advisory
-
packetstormsecurity.com
/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html
third-party-advisory
- packetstormsecurity.com /files/166540/PostgreSQL-11.7-Remote-Code-Execution.html
- packetstormsecurity.com /files/171722/PostgreSQL-9.6.1-Remote-Code-Execution.html
Sources
- CVE List CVE-2019-9193
- NVD CVE-2019-9193
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.