CVE-2018-10915 SQL injection in postgresql

High 8.5 Published Updated

Attackers can bypass security features and execute SQL injection via untrusted connection parameters in the libpq library, leading to privilege escalation or data exposure.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2018-10915?

CVE-2018-10915 is a high-severity SQL injection vulnerability in Canonical Ubuntu Linux, published on 9 Aug 2018. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

A vulnerability was found in libpq, the default PostgreSQL client library where libpq failed to properly reset its internal state between connections. If an affected version of libpq was used with "host" or "hostaddr" connection parameters from untrusted input, attackers could bypass client-side connection security features, obtain access to higher privileged connections or potentially cause other impact through SQL injection, by causing the PQescape() functions to malfunction. Postgresql versions before 10.5, 9.6.10, 9.5.14, 9.4.19, and 9.3.24 are affected.

Weakness: CWE-89, CWE-665, CWE-200

Which versions are affected by CVE-2018-10915?

It affects 9 products.

Linux distribution packages (40)
postgresql Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-contrib Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-debuginfo Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-devel Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-docs Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-libs Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-plperl Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-plpython Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-pltcl Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-server Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-static Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-test Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql-upgrade Red Hat:enterprise_linux:7::clientAll versions0:9.2.24-1.el7_5
postgresql Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-contrib Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-debuginfo Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-devel Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-docs Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-libs Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-plperl Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-plpython Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-pltcl Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-server Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-static Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-test Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql-upgrade Red Hat:enterprise_linux:7::computenodeAll versions0:9.2.24-1.el7_5
postgresql Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-contrib Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-debuginfo Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-devel Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-docs Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-libs Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-plperl Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-plpython Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-pltcl Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-server Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-static Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-test Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql-upgrade Red Hat:enterprise_linux:7::serverAll versions0:9.2.24-1.el7_5
postgresql Red Hat:enterprise_linux:7::workstationAll versions0:9.2.24-1.el7_5

Products include Canonical Ubuntu Linux, Debian Debian Linux, Postgresql Postgresql, Redhat Enterprise Linux Desktop, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Eus and 3 more.

How do I fix CVE-2018-10915?

Upgrade to a fixed version.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2018-10915 being exploited?

There is no known exploitation of CVE-2018-10915 in the wild and no public exploit code.

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2018-10915, CLEANSTART-2026-UI46726, DLA-1464-1, GHSA-q7vw-gjh3-qf97, RHSA-2018:2557, SUSE-SU-2018:3287-1 and 2 more.

Is CVE-2018-10915 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free