cve.bz

CVE-2018-1058 Improper Input Validation

8.8 highEPSS 13%

High (8.8). EPSS 13% estimated probability of exploitation activity in the next 30 days.

On this page
A flaw was found in the way Postgresql allowed a user to modify the behavior of a query for other users. An attacker with a user account could use this flaw to execute code with the permissions of superuser in the database. Versions 9.3 through 10 are affected.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
13% (unchanged from 13% a week ago; 13% 30 days ago) estimated probability of exploitation activity in the next 30 days; 96th percentile. Scored 2026-11-23. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-20 Improper Input Validation
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-1058 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2018-1058?via=ask-ai-copy and https://cve.bz/cve/CVE-2018-1058?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-1058 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 9.3 before 9.3.22
postgresql:postgresqlfrom 9.4 before 9.4.17
postgresql:postgresqlfrom 9.5 before 9.5.12
postgresql:postgresqlfrom 9.6 before 9.6.8
postgresql:postgresqlfrom 10.0 before 10.3
canonical:ubuntu_linux14.04
canonical:ubuntu_linux16.04
canonical:ubuntu_linux17.10
redhat:cloudforms4.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu14.04:LTSpostgresql-9.39.3.22-0ubuntu0.14.04UBUNTU-CVE-2018-1058 USN-3589-1
Ubuntu16.04:LTSpostgresql-9.59.5.12-0ubuntu0.16.04UBUNTU-CVE-2018-1058 USN-3589-1
Ubuntu18.04:LTSpostgresql-1010.3-1UBUNTU-CVE-2018-1058
Red Hatcloudforms_managementengine:5.9::el7cfme, cfme-debuginfo0:5.9.6.5-3.el7cfRHSA-2018:3816
Red Hatcloudforms_managementengine:5.9::el7cfme-appliance, cfme-appliance-tools, cfme-appliance-common and 1 more0:5.9.6.5-1.el7cfRHSA-2018:3816
Red Hatcloudforms_managementengine:5.9::el7cfme-gemset, cfme-gemset-debuginfo, cfme-amazon-smartstate0:5.9.6.5-2.el7cfRHSA-2018:3816
Red Hatcloudforms_managementengine:5.9::el7dbus-api-service0:1.0.1-3.1.el7cfRHSA-2018:3816
Red Hatcloudforms_managementengine:5.9::el7httpd-configmap-generator0:0.2.2-1.2.el7cfRHSA-2018:3816
Red Hatcloudforms_managementengine:5.9::el7postgresql96, postgresql96-docs, postgresql96-libs and 8 more0:9.6.10-1PGDG.el7atRHSA-2018:3816
Red Hatrhel_software_collections:3::el6rh-postgresql95-postgresql, rh-postgresql95-postgresql-docs, rh-postgresql95-postgresql-libs and 9 more0:9.5.14-1.el6RHSA-2018:2511
Red Hatrhel_software_collections:3::el6rh-postgresql96-postgresql, rh-postgresql96-postgresql-docs, rh-postgresql96-postgresql-libs and 12 more0:9.6.10-1.el6RHSA-2018:2566
Red Hatrhel_software_collections:3::el7rh-postgresql95-postgresql, rh-postgresql95-postgresql-docs, rh-postgresql95-postgresql-libs and 9 more0:9.5.14-1.el7RHSA-2018:2511
Red Hatrhel_software_collections:3::el7rh-postgresql96-postgresql, rh-postgresql96-postgresql-docs, rh-postgresql96-postgresql-libs and 12 more0:9.6.10-1.el7RHSA-2018:2566
SUSELinux Enterprise Desktop 12 SP2, Linux Enterprise Desktop 12 SP3, Linux Enterprise Server 12 SP2 and 4 morepostgresql96, postgresql96-libs9.6.8-3.16.1SUSE-SU-2018:0756-1
SUSELinux Enterprise Desktop 12 SP2, Linux Enterprise Server 12 SP2, Linux Enterprise Server for Raspberry Pi 12 SP2 and 1 morepostgresql949.4.17-21.19.1SUSE-SU-2018:0876-1
SUSELinux Enterprise Server 11 SP4, Linux Enterprise Server for SAP Applications 11 SP4postgresql94, postgresql94-libs9.4.17-0.23.16.1SUSE-SU-2018:0755-1
SUSELinux Enterprise Software Development Kit 11 SP4postgresql94-libs9.4.17-0.23.16.1SUSE-SU-2018:0755-1
SUSELinux Enterprise Software Development Kit 12 SP2postgresql94-libs9.4.17-21.19.1SUSE-SU-2018:0876-1
SUSELinux Enterprise Software Development Kit 12 SP2, Linux Enterprise Software Development Kit 12 SP3postgresql96-libs9.6.8-3.16.1SUSE-SU-2018:0756-1
openSUSETumbleweedkubectl-cnpg1.29.2-1.1openSUSE-SU-2026:11167-1
openSUSETumbleweedpostgresql1010.18-1.3openSUSE-SU-2024:11184-1
Alpinev3.4postgresql9.5.12-r0ALPINE-CVE-2018-1058
Alpinev3.5, v3.6postgresql9.6.8-r0ALPINE-CVE-2018-1058
Alpinev3.7, v3.8, v3.9 and 5 morepostgresql10.3-r0ALPINE-CVE-2018-1058
Alpinev3.15, v3.16postgresql1410.3-r0ALPINE-CVE-2018-1058
Alpinev3.17, v3.18, v3.19 and 1 morepostgresql14, postgresql1510.3-r0ALPINE-CVE-2018-1058

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

Red Hat's statement

This issue affects the versions of Postgresql as shipped with Red Hat Satellite 5. Red Hat Product Security has rated this issue as having security impact of Low. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Red Hat's mitigation

Upstream suggests the following mitigation can be used to protect against this security flaw:

https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058:_Protect_Your_Search_Path

ProductPackageStateAdvisory
CloudForms Management Engine 5.9cfme-0:5.9.6.5-3.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9cfme-amazon-smartstate-0:5.9.6.5-2.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9cfme-appliance-0:5.9.6.5-1.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9cfme-gemset-0:5.9.6.5-2.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9dbus-api-service-0:1.0.1-3.1.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9httpd-configmap-generator-0:0.2.2-1.2.el7cfFixed 2018-12-13RHSA-2018:3816
CloudForms Management Engine 5.9postgresql96-0:9.6.10-1PGDG.el7atFixed 2018-12-13RHSA-2018:3816
Red Hat Software Collections for Red Hat Enterprise Linux 6rh-postgresql95-postgresql-0:9.5.14-1.el6Fixed 2018-08-20RHSA-2018:2511
Red Hat Software Collections for Red Hat Enterprise Linux 6rh-postgresql96-postgresql-0:9.6.10-1.el6Fixed 2018-08-27RHSA-2018:2566
Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUSrh-postgresql95-postgresql-0:9.5.14-1.el6Fixed 2018-08-20RHSA-2018:2511
CloudForms Management Engine 5postgresql94Will not fix
Red Hat Enterprise Linux 5postgresqlWill not fix
Red Hat Enterprise Linux 5postgresql84Will not fix
Red Hat Enterprise Linux 6postgresqlWill not fix
Red Hat Enterprise Linux 7postgresqlWill not fix
Red Hat Enterprise Linux 8postgresqlNot affected
Red Hat JBoss Fuse Service Works 6postgresqlNot affected
Red Hat JBoss Operations Network 3postgresqlNot affected
Red Hat Mobile Application Platform 4postgresqlNot affected
Red Hat Satellite 5postgresql95-postgresqlWill not fix
12 more in the JSON and on Red Hat's page.

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

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-20 (51).

References

Check your stackJSON