CVE-2019-9193Postgresql OS Command Injection
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.
Published Apr 1, 2019 · Updated Nov 21, 2024
Key Facts
Patch immediately- CVE-2019-9193 is a high-severity vulnerability (CVSS 7.2 v3) affecting Postgresql, postgresql10-devel (photon), postgresql10 (photon) and 1 more product.
- It is exploited in the wild, listed in Industry KEV feed since Jan 22, 2021. Public exploit code is available.
- EPSS estimates a 92% probability of exploitation in the next 30 days.
- Fixed versions are available, including Postgresql NA, Postgresql <=11.2, postgresql10 NA.
- Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Scores
CVSS v3
7.2
CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
EPSS (30-day exploit likelihood)
92%
Higher than 99.8% of all scored CVEs
Exploit maturity
Exploited (KEV)
ATLAS score
81/100
Publication score, see How it works
Exploitation Verdict
KEV listed
Jan 22, 2021
662 days after publication
Federal due date
None
No federal due date
Ransomware use
Not reported
Attributed actors
None named
Exploit & Defence Guidance
Exploit maturity
Exploited (KEV)
Public exploit code
4
Proof-of-concept links
In-the-wild evidence
5
Reports of active use
Advisories And Exploit References
- advisoryhttp://packetstormsecurity.com/files/152757/PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.html
- advisoryhttps://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/
- advisoryhttps://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/
- advisoryhttps://security.netapp.com/advisory/ntap-20190502-0003/
- advisoryhttps://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/
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’.
Known-Exploited Catalog Listings
| Catalog | Added | Remediation due | Ransomware use |
|---|---|---|---|
| Industry KEV feed | Jan 22, 2021 | n/a | Not reported |
Affected Products
7 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| PostgresqlPostgresql | See advisory | 11.2 |
| postgresql10-develphoton | See advisory | NA |
| postgresql10photon | See advisory | NA |
| postgresql10-libsphoton | See advisory | NA |
Patched Releases
Postgresql
NA, <=11.2
postgresql10
NA
postgresql10-devel
NA
postgresql10-libs
NA
Timeline
Publicly disclosed
Apr 1, 2019
Added to Industry KEV feed
Jan 22, 2021
Last updated
Nov 21, 2024
Weakness Type
- CWE-20 Improper Input Validation
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
References
- advisorypacketstormsecurity.com · PostgreSQL-COPY-FROM-PROGRAM-Command-Execution.…
- advisoryblog.hagander.net · when-a-vulnerability-is-not-a-vulnerability-244
- advisorypaquier.xyz · postgres-9-3-feature-highlight-copy-tofrom-prog…
- advisorysecurity.netapp.com · ntap-20190502-0003
- advisorytrustwave.com · authenticated-arbitrary-command-execution-on-po…
FAQ
Common Questions.
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.
Affected: Postgresql; postgresql10-devel (photon); postgresql10 (photon), among others. The full list is in the CVE brief.
It is exploited in the wild, listed in Industry KEV feed since Jan 22, 2021.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
Public exploit code is available.
Fixed versions are available, including Postgresql NA, Postgresql <=11.2, postgresql10 NA.
Brandefense priority: patch immediately, because it is listed as exploited in the wild.
Is CVE-2019-9193 On Your Attack Surface?
Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.
Request A Demo