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’.
In plain language
AI Worth attentionCVE-2019-9193 is a PostgreSQL feature that can let highly privileged users run operating-system commands through “COPY TO/FROM PROGRAM”; if you don’t allow that level of database privilege, a typical small business is less likely to be affected, but the public exploit availability means you should still tighten access because there’s no known patch.
CVE-2019-9193 is an abuse of PostgreSQL’s “COPY TO/FROM PROGRAM” capability (COPY TO/FROM PROGRAM), where a superuser or a member of the pg_execute_server_program group can execute arbitrary operating-system commands as the database server user; public exploits exist, but no vendor patch was identified in the provided findings.
What to do now
- Confirm whether your PostgreSQL version is between 9.3 and 11.2.
- Check which database accounts are superusers.
- Check whether any accounts are members of the pg_execute_server_program group.
- Remove the pg_execute_server_program role membership from non-essential users (or revoke the capability from everyone except fully trusted admins).
- If you truly require this feature, limit it to a tightly controlled set of accounts and hosts; otherwise, avoid using “COPY TO/FROM PROGRAM”.
- Upgrade PostgreSQL to a version outside 9.3–11.2 if you can; since no patch is listed in the findings, upgrade and privilege tightening are the practical mitigations.
CVSS Vector Breakdown
AV:NAttack VectorAC:LAttack ComplexityPR:HPrivileges RequiredUI:NUser InteractionS:UScopeC:HConfidentialityI:HIntegrityA:HAvailabilityWeaknesses
Affected Products
Exploitability
Exploit details including PoC links, Metasploit modules, and scanner templates are available after registration.
View exploit detailsAttack Graph
Click technique nodes for MITRE ATT&CK details · drag to pan · Ctrl/⌘ + scroll to zoom, or go fullscreen.
MITRE ATT&CK
1 techniqueReferences
Unlock Complete Vulnerability Intelligence
Get the full picture for CVE-2019-9193 and every CVE in our database. Create a free account — no credit card required.
Create Free Account