CVE-2019-10208: SQL Injection

Published Jul 30, 2019
·
Updated

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

13 affected componentsFixes available
redhat/postgresql<0:9.2.24-6.el7_9
0:9.2.24-6.el7_9
redhat/rh-postgresql10-postgresql<0:10.12-2.el7
0:10.12-2.el7
redhat/rh-postgresql96-postgresql<0:9.6.19-1.el7
0:9.6.19-1.el7
redhat/postgresql<11.5
11.5
redhat/postgresql<10.10
10.10
redhat/postgresql<9.6.15
9.6.15
redhat/postgresql<9.5.19
9.5.19
redhat/postgresql<9.4.24
9.4.24
PostgreSQL postgresql>=9.4.0<9.4.24
PostgreSQL postgresql>=9.5.0<9.5.19
PostgreSQL postgresql>=9.6.0<9.6.15
PostgreSQL postgresql>=10.0<10.10
PostgreSQL postgresql>=11.0<11.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 0:9.2.24-6.el7_9
  2. Upgrade

    Upgrade redhat/rh-postgresql10-postgresql to a version that resolves this vulnerability.

    Fixed in 0:10.12-2.el7
  3. Upgrade

    Upgrade redhat/rh-postgresql96-postgresql to a version that resolves this vulnerability.

    Fixed in 0:9.6.19-1.el7
  4. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 11.5
  5. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 10.10
  6. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 9.6.15
  7. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 9.5.19
  8. Upgrade

    Upgrade redhat/postgresql to a version that resolves this vulnerability.

    Fixed in 9.4.24

Event History

Jul 30, 2019
Data Sourced
via Red Hat·01:52 PM
DescriptionSeverityAffected Software
Aug 8, 2019
CVE Published
12:00 AM
Oct 29, 2019
CVE Published
via MITRE·01:13 PM
Data Sourced
via MITRE·01:13 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the vulnerability ID for this flaw in PostgreSQL?

The vulnerability ID for this flaw in PostgreSQL is CVE-2019-10208.

2

What is the severity level of CVE-2019-10208?

CVE-2019-10208 has a severity level of high.

3

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.

4

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.

5

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).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203