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 execute arbitrary code in the context of the database's...
High CVSS 7.2
- CVE id
- CVE-2019-9193
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| PostgreSQL Runtimes and servers |
>= 9.3, <= 11.2 | after 11.2 |
How to fix it
Upgrade PostgreSQL to a release newer than 11.2.
psql -c 'SELECT version();'
- Install the patched PostgreSQL minor release of your major version (the postgres image tag, the PGDG packages, or your provider's maintenance update) and restart the server; minor releases need no dump or pg_upgrade.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pgexecuteserver_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’.
References
- CVE-2019-9193 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2019-9193
- Web: https://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/
- Web: https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5
- Web: https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/
- Web: https://security.netapp.com/advisory/ntap-20190502-0003/
- Web: https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/
- Web: https://blog.hagander.net/when-a-vulnerability-is-not-a-vulnerability-244/
- Web: https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5
- Web: https://paquier.xyz/postgresql-2/postgres-9-3-feature-highlight-copy-tofrom-program/
- Web: https://security.netapp.com/advisory/ntap-20190502-0003/
- Web: https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/authenticated-arbitrary-command-execution-on-postgresql-9-3/
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.