CVE-2026-61817

pg_partman privilege escalation via SQL injection in several functions via time decoder

Published Sep 18, 2026 CVSS 3.1 · 8.5 High EPSS < 1% KEV · Not listed
Description
pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, run_maintenance(), show_partitions(), show_partition_info(), undo_partition(), and partition_data_time() interpolate the writable part_config.time_dncoder text value without identifier quoting into dynamic SQL. A role with the documented partman_user privileges can store SQL rather than a decoder function name. When an affected operation later uses the poisoned value, including pg_partman_bgw maintenance for a text- or UUID-keyed set, the SQL executes with the operation's privileges, which can be the default PostgreSQL superuser background-worker role. The persistent row can restore elevated access on later ticks, and successful exploitation can permit database-wide compromise and operating-system command execution as the PostgreSQL service account. This issue is fixed in version 5.5.0.

Analysis

AI-generated

Technical impact

The vulnerability allows a role with partman_user privileges to inject SQL into dynamic queries that use the time_dncoder text value of the writable part_config table. This injection can be executed when maintenance or background‑worker functions run, granting the attacker database‑wide control and, in the worst case, the ability to run operating‑system commands as the PostgreSQL service account. The flaw stems from improper quoting of the time_dncoder value in dynamic SQL, a classic SQL injection weakness (CWE‑89).

Affected Systems

The issue affects the pg_partman extension for PostgreSQL (pgpartman) in all releases prior to 5.5.0. Any environment that uses the run_maintenance(), show_partitions(), show_partition_info(), undo_partition(), or partition_data_time() functions is vulnerable unless that extension is upgraded.

Risk and Exploitability

The CVSS base score of 8.5 indicates high severity. The EPSS score is not available, but no known public exploitation is listed in CISA's KEV catalog. Attackers can exploit the flaw from a role with partman_user privileges, and the injected SQL will run with the privileges of the background worker, which may be a PostgreSQL superuser. Successful exploitation could lead to database‑wide compromise and operating‑system command execution.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pg_partman to version 5.5.0 or later, which removes the vulnerable dynamic SQL handling.
  • Avoid storing arbitrary SQL in part_config.time_dncoder; ensure it contains only valid decoder function names.
  • Limit partman_user role privileges or restrict roles that can modify the part_config table to trusted users only.

Generated by OpenCVE AI on September 19, 2026 at 11:15 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pgxn
Pgxn pg Partman
Vendors & Products Pgxn
Pgxn pg Partman
Type Values Removed Values Added
Description pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, run_maintenance(), show_partitions(), show_partition_info(), undo_partition(), and partition_data_time() interpolate the writable part_config.time_dncoder text value without identifier quoting into dynamic SQL. A role with the documented partman_user privileges can store SQL rather than a decoder function name. When an affected operation later uses the poisoned value, including pg_partman_bgw maintenance for a text- or UUID-keyed set, the SQL executes with the operation's privileges, which can be the default PostgreSQL superuser background-worker role. The persistent row can restore elevated access on later ticks, and successful exploitation can permit database-wide compromise and operating-system command execution as the PostgreSQL service account. This issue is fixed in version 5.5.0.
Title pg_partman privilege escalation via SQL injection in several functions via time decoder
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 8.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 19, 2026, 2:11 PM
Reserved
Jul 10, 2026, 8:17 PM
Status
Awaiting Analysis
Published
Sep 18, 2026, 8:17 PM
Modified
Sep 24, 2026, 9:22 PM