CVE-2018-1058

HIGH LAB

PostgreSQL 9.3-10 - Authenticated Remote Code Execution via Query Behavior Modification

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2018-1058. PoCs published by ccchme.

AI-analyzed exploit summary This repository demonstrates CVE-2018-1058, a PostgreSQL privilege escalation vulnerability via uncontrolled search path. It includes a Docker-based environment to reproduce the attack, where an attacker creates a malicious function in the public schema that a victim unknowingly executes.

Description

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.

Exploits (1)

nomisec WORKING POC
by ccchme · poc
https://github.com/ccchme/CVE-2018-1058

This repository demonstrates CVE-2018-1058, a PostgreSQL privilege escalation vulnerability via uncontrolled search path. It includes a Docker-based environment to reproduce the attack, where an attacker creates a malicious function in the public schema that a victim unknowingly executes.

Classification
Working Poc 95%
Attack Type
Auth Bypass
Complexity
Moderate
Reliability
Reliable
Target: PostgreSQL 10.2
Auth required
Prerequisites: Docker · Docker Compose · PostgreSQL client (optional)
devstral-2 · analyzed May 19, 2026 Full analysis →

References (7)

Core 7
Core References
Issue Tracking, Third Party Advisory x_refsource_confirm
https://bugzilla.redhat.com/show_bug.cgi?id=1547044
Third Party Advisory vendor-advisory x_refsource_ubuntu
https://usn.ubuntu.com/3589-1/
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/103221
Vendor Advisory x_refsource_confirm
https://www.postgresql.org/about/news/1834/
Third Party Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2018:2511
Third Party Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2018:2566
Third Party Advisory vendor-advisory x_refsource_redhat
https://access.redhat.com/errata/RHSA-2018:3816

Scores

CVSS v3 8.8
EPSS 0.8201
EPSS Percentile 99.2%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Lab Environment

COMMUNITY
Community Lab
docker pull postgres:10.2
docker pull postgres:10.3

Details

CWE
CWE-20
Status published
Products (5)
canonical/ubuntu_linux 14.04
canonical/ubuntu_linux 16.04
canonical/ubuntu_linux 17.10
postgresql/postgresql 9.3 - 9.3.22
redhat/cloudforms 4.6
Published Mar 02, 2018
Tracked Since Feb 18, 2026