{"id":"CVE-2019-9193","published":"2019-04-01T00:00:00Z","modified":"2024-11-15T15:13:38Z","title":"In PostgreSQL 9.3 through 11.2, the \"COPY TO/FROM PROGRAM\" function allows superusers and users in the…","vendor":null,"product":null,"tier":"core","eol":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-04-24T17:12:53.867918Z","from":"CISA ADP","provenance":"source"},"description":{"text":"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’.","provenance":"source","from":"CVE.org"},"summary":{"text":"The COPY TO/FROM PROGRAM function in PostgreSQL 9.3 through 11.2 lets superusers and members of the pg_execute_server_program group run arbitrary code as the database's operating system user, and it is enabled by default. An attacker who holds one of those database roles can use it to run arbitrary operating system commands on Windows, Linux, or macOS, with no further conditions required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T07:15:06Z"},"cvss":null,"epss":{"score":0.91655,"percentile":0.99819,"date":"2026-11-20","provenance":"source"},"kev":null,"vulncheckKev":{"dateAdded":"2021-01-22","exploitedFirstSeen":"2021-01-22","ransomware":false,"evidence":[{"url":"https://www.zscaler.com/blogs/security-research/dreambus-botnet-technical-analysis","date":"2021-01-22"},{"url":"https://cujo.com/the-sysrv-botnet-and-how-it-evolved/","date":"2021-09-22"},{"url":"https://www.botconf.eu/wp-content/uploads/2022/05/Botconf2022-24-PalotayZsigovits.pdf","date":"2022-04-27"},{"url":"https://www.trustwave.com/hubfs/Web/Library/Documents_pdf/2024_Trustwave_Public_Sector_Threat_Landscape.pdf","date":"2024-05-14"}],"evidenceTotal":4,"provenance":"source"},"exploited":true,"otx":{"pulseCount":3,"pulses":[{"name":"PGMiner: New Cryptocurrency Mining Botnet Delivered via PostgreSQL","url":"https://otx.alienvault.com/pulse/63bd353b8a9fe195b1d182cb","created":"2023-01-10"},{"name":"PGMiner挖矿木马IOC","url":"https://otx.alienvault.com/pulse/6229ac81f6003ccfd6c4f91c","created":"2022-03-10"},{"name":"PGMiner: New Cryptocurrency Mining Botnet Delivered via PostgreSQL","url":"https://otx.alienvault.com/pulse/5fd25a0b2ce8fff45b18ea45","created":"2020-12-10"}],"provenance":"machine"},"cwes":[],"references":[{"url":"https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/","tags":[]},{"url":"https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5","tags":[]},{"url":"https://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/","tags":[]},{"url":"https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20190502-0003/","tags":[]},{"url":"http://packetstormsecurity.com/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html","tags":[]},{"url":"http://packetstormsecurity.com/files/166540/PostgreSQL-11.7-Remote-Code-Execution.html","tags":[]},{"url":"http://packetstormsecurity.com/files/171722/PostgreSQL-9.6.1-Remote-Code-Execution.html","tags":[]}],"techniques":[],"reports":[],"affected":[],"advisories":[],"euvd":{"id":"EUVD-2019-18570","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2019-18570","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[{"id":46813,"url":"https://www.exploit-db.com/exploits/46813","title":"PostgreSQL 9.3 - COPY FROM PROGRAM Command Execution (Metasploit)","type":"remote","platform":"multiple","date":"2019-05-08","verified":true,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":1,"earliest":"2019-05-08"},"pocGithub":{"count":8,"skipped":2,"earliest":"2020-02-12","earliestUrl":"https://github.com/wkjung0624/cve-2019-9193","repos":[{"name":"b4keSn4ke/CVE-2019-9193","url":"https://github.com/b4keSn4ke/CVE-2019-9193","stars":23,"created":"2022-03-29"},{"name":"geniuszly/CVE-2019-9193","url":"https://github.com/geniuszly/CVE-2019-9193","stars":4,"created":"2024-10-06"},{"name":"wkjung0624/cve-2019-9193","url":"https://github.com/wkjung0624/cve-2019-9193","stars":3,"created":"2020-02-12"},{"name":"paulotrindadec/CVE-2019-9193","url":"https://github.com/paulotrindadec/CVE-2019-9193","stars":1,"created":"2023-02-01"},{"name":"jhnhnck/CVE-2019-9193","url":"https://github.com/jhnhnck/CVE-2019-9193","stars":0,"created":"2025-03-20"}]},"metasploit":[{"name":"PostgreSQL COPY FROM PROGRAM Command Execution","module":"exploit/multi/postgres/postgres_copy_from_program_cmd_exec","type":"exploit","disclosureDate":"2019-03-20","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb"}],"nuclei":[{"id":"CVE-2019-9193","name":"PostgreSQL 9.3-12.3 Authenticated Remote Code Execution","severity":"high","path":"javascript/cves/2019/CVE-2019-9193.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/cves/2019/CVE-2019-9193.yaml"}],"first":{"date":"2019-03-20","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb"},"provenance":"source"},"exploitRefs":["http://packetstormsecurity.com/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html","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"],"flow":[],"timeline":[{"date":"2019-03-20","kind":"exploit-public","label":"First public exploit: Metasploit; later: Exploit-DB 2019-05-08, PoC-in-GitHub 2020-02-12","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb","provenance":"source"},{"date":"2019-04-01","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2019-9193","provenance":"source"},{"date":"2021-01-22","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.zscaler.com/blogs/security-research/dreambus-botnet-technical-analysis","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":"Metasploit","daysToKev":null},"priority":{"score":61.3,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 2129 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.96,"detail":"percentile 0.9982"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"1 Exploit-DB entry; 3 NVD exploit links; 8 PoC-in-GitHub repos; 1 Metasploit module; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":1.37,"detail":"3 pulses"},{"name":"CVSS severity","points":0.0,"detail":"no CVSS"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}