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

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
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