cve.bz

CVE-2018-16850 SQL Injection

9.8 criticalEPSS 5.1%Fix available

Critical (9.8). EPSS 5.1% estimated probability of exploitation activity in the next 30 days.

On this page
postgresql before versions 11.1, 10.6 is vulnerable to a to SQL injection in pg_upgrade and pg_dump via CREATE TRIGGER ... REFERENCING. Using a purpose-crafted trigger definition, an attacker can cause arbitrary SQL statements to run, with superuser privileges.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
5.1% (unchanged from 5.1% a week ago; 5.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 93rd percentile. Scored 2026-11-23. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2018-16850 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2018-16850?via=ask-ai-copy and https://cve.bz/cve/CVE-2018-16850?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2018-16850 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
postgresql:postgresqlfrom 10.0 before 10.6
postgresql:postgresqlfrom 11.0 before 11.1
redhat:enterprise_linux7.0
redhat:enterprise_linux7.4
redhat:enterprise_linux7.5
redhat:enterprise_linux7.6
canonical:ubuntu_linux18.04
canonical:ubuntu_linux18.10

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu18.04:LTSpostgresql-1010.6-0ubuntu0.18.04.1UBUNTU-CVE-2018-16850 USN-3818-1
Red Hatrhel_software_collections:3::el7rh-postgresql10-postgresql, rh-postgresql10-postgresql-docs, rh-postgresql10-postgresql-libs and 12 more0:10.6-1.el7RHSA-2018:3757
SUSELinux Enterprise Desktop 12 SP3, Linux Enterprise Server 12 SP3, Linux Enterprise Server for SAP Applications 12 SP3postgresql10, postgresql10-libs10.6-1.6.1SUSE-SU-2018:3770-1
SUSELinux Enterprise Desktop 12 SP4, Linux Enterprise Server 12 SP4, Linux Enterprise Server for SAP Applications 12 SP4postgresql10, postgresql10-libs10.6-1.6.1SUSE-SU-2018:3770-2
SUSELinux Enterprise Module for Basesystem 15, Linux Enterprise Module for Package Hub 15, Linux Enterprise Module for Server Applications 15postgresql1010.6-4.8.1SUSE-SU-2018:3942-1
SUSELinux Enterprise Software Development Kit 12 SP3postgresql10-libs10.6-1.6.1SUSE-SU-2018:3770-1
SUSELinux Enterprise Software Development Kit 12 SP4postgresql10-libs10.6-1.6.1SUSE-SU-2018:3770-2
openSUSETumbleweedpostgresql1010.18-1.3openSUSE-SU-2024:11184-1
openSUSETumbleweedpostgresql1111.13-1.3openSUSE-SU-2024:11185-1
Alpinev3.9, v3.10, v3.11 and 3 morepostgresql11.1-r0ALPINE-CVE-2018-16850
Alpinev3.15, v3.16postgresql1411.1-r0ALPINE-CVE-2018-16850
Alpinev3.17, v3.18, v3.19 and 1 morepostgresql14, postgresql1511.1-r0ALPINE-CVE-2018-16850

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This issue did not affect the versions of postgresql as shipped with Red Hat Enterprise Linux 5, 6, and 7 as they did not include support for triggers with `referecing` syntax, which was included in a later version of the program.

It also doesn't affect the versions of postgresql shipped with CloudForms 4.2, 4.5 and 4.6, and Satellite 5, for the same reason as above.

This issue did not affect the versions of postgresql shipped within Tower, as there is no code path for Tower users to call the CREATE statement.

ProductPackageStateAdvisory
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-postgresql10-postgresql-0:10.6-1.el7Fixed 2018-12-03RHSA-2018:3757
Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUSrh-postgresql10-postgresql-0:10.6-1.el7Fixed 2018-12-03RHSA-2018:3757
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUSrh-postgresql10-postgresql-0:10.6-1.el7Fixed 2018-12-03RHSA-2018:3757
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUSrh-postgresql10-postgresql-0:10.6-1.el7Fixed 2018-12-03RHSA-2018:3757
CloudForms Management Engine 5postgresql96Not affected
Red Hat Ansible Tower 3postgresql96-libsNot affected
Red Hat Enterprise Linux 5postgresqlNot affected
Red Hat Enterprise Linux 6postgresqlNot affected
Red Hat Enterprise Linux 7postgresqlNot affected
Red Hat Enterprise Linux 8libpqNot affected
Red Hat Enterprise Linux 8postgresqlNot affected
Red Hat Satellite 5rh-postgresql95-postgresqlNot affected
Red Hat Software Collectionsrh-postgresql95-postgresqlNot affected
Red Hat Software Collectionsrh-postgresql96-postgresqlNot affected
Red Hat Virtualization 4postgresqlNot affected
Red Hat Virtualization 4rh-postgresql95-postgresqlNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2018-16850.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON