CVE-2019-10208: SQL Injection
A flaw was discovered in postgresql versions 9.4.x before 9.4.24, 9.5.x before 9.5.19, 9.6.x before 9.6.15, 10.x before 10.10 and 11.x before 11.5 where arbitrary SQL statements can be executed given a suitable SECURITY DEFINER function. An attacker, with EXECUTE permission on the function, can execute arbitrary SQL as the owner of the function.
Other sources
A flaw was discovered in postgresql where arbitrary SQL statements can be executed given a suitable SECURITY DEFINER function. An attacker, with EXECUTE permission on the function, can execute arbitrary SQL as the owner of the function.
Given a suitable SECURITY DEFINER function, an attacker can execute arbitrary SQL under the identity of the function owner. An attack requires EXECUTE permission on the function, which must itself contain a function call having inexact argument type match. For example, length('foo'::varchar) and length('foo') are inexact, while length('foo'::text) is exact. As part of exploiting this vulnerability, the attacker uses CREATE DOMAIN to create a type in a pgtemp schema. The attack pattern and fix are similar to that for CVE-2007-2138. Writing SECURITY DEFINER functions continues to require following the considerations noted in the documentation, though this vulnerability affects functions observing them and functions not observing them:
References:
https://www.postgresql.org/docs/devel/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 0:9.2.24-6.el7_9 - Upgrade
Upgrade
redhat/rh-postgresql10-postgresqlto a version that resolves this vulnerability.Fixed in 0:10.12-2.el7 - Upgrade
Upgrade
redhat/rh-postgresql96-postgresqlto a version that resolves this vulnerability.Fixed in 0:9.6.19-1.el7 - Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 11.5 - Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 10.10 - Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 9.6.15 - Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 9.5.19 - Upgrade
Upgrade
redhat/postgresqlto a version that resolves this vulnerability.Fixed in 9.4.24
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the vulnerability ID for this flaw in PostgreSQL?
The vulnerability ID for this flaw in PostgreSQL is CVE-2019-10208.
What is the severity level of CVE-2019-10208?
CVE-2019-10208 has a severity level of high.
How can arbitrary SQL statements be executed in PostgreSQL due to this vulnerability?
Arbitrary SQL statements can be executed in PostgreSQL due to this vulnerability when a suitable SECURITY DEFINER function is provided.
Which versions of PostgreSQL are affected by CVE-2019-10208?
Versions 9.4.x, 9.5.x, 9.6.x, 10.x, and 11.x of PostgreSQL are affected by CVE-2019-10208.
Where can I find more information about CVE-2019-10208?
You can find more information about CVE-2019-10208 at the following references: [Reference 1](https://access.redhat.com/security/cve/CVE-2007-2138), [Reference 2](https://www.postgresql.org/docs/devel/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY), [Reference 3](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1739217).