Skip to content

PostgreSQL Privilege Escalation Through Missing Schema Qualifiers

High
camilodiazsal published GHSA-7r4w-fw4h-67gp May 10, 2023

Package

aiven-extras (PostgreSQL)

Affected versions

< 1.1.9

Patched versions

1.1.9 and later

Description

Impact

This is a privilege escalation vulnerability, allowing elevation to superuser inside PostgreSQL databases that use the aiven-extras package. The vulnerability leverages missing schema qualifiers on privileged functions called by the aiven-extras extension. A low privileged user can create objects that collide with existing function names, which will then be executed instead.

Exploiting this vulnerability could allow a low privileged user to acquire superuser privileges, which would allow full, unrestricted access to all data and database functions. And could lead to arbitrary code execution or data access on the underlying host as the postgres user.

Known Affected Software Configurations

aiven-extras prior to version 1.1.9 on the following versions of PostgreSQL:

  • 10.0 up to 10.22
  • 11.0 up to 11.17
  • 12.0 up to 12.12
  • 13.0 up to 13.8
  • 14.0 up to 14.5

Patches

The issue has been patched as of version 1.1.9.

References

The issue shares the same root cause as CVE-2018-1058 so the following write-up serves as a sufficient technical description of the vulnerability: https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058%3A_Protect_Your_Search_Path

Credit

Thanks to Sven Klemm for finding and reporting the vulnerability.

Severity

High
8.8
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2023-32305

Weaknesses

Credits