CVE-2026-61781: pg_partman has privilege escalation through SQL injection in create_partition_time()

Published Sep 18, 2026
·
Updated

pgpartman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, createpartitiontime() reads the writable partconfig.timeencoder text value and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with the documented partmanuser INSERT and UPDATE privileges can store SQL rather than a function name. When pgpartmanbgw later creates a child partition for a text- or UUID-keyed set, the worker executes the stored SQL with pgpartmanbgw.role privileges, which default to PostgreSQL superuser. The persistent configuration row can repeatedly restore elevated access on later maintenance 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.

Affected Software

1 affected component
pg_partman pg_partman<5.5.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pg_partman to a version that resolves this vulnerability.

    Fixed in 5.5.0

Event History

Sep 18, 2026
CVE Published
via MITRE·07:44 PM
Data Sourced
via MITRE·07:44 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are realistically exposed?

Deployments using pg_partman before 5.5.0 are exposed when a text- or UUID-keyed partition set is maintained by pg_partman_bgw. The risk is greatest where the background worker runs with its default PostgreSQL superuser role.

2

What access does an attacker need to exploit this?

An attacker needs a role granted the documented partman_user INSERT and UPDATE privileges. They can write SQL into part_config.time_encoder, which is intended to contain a function name.

3

Is exploitation dependent on interactive timing or a separate privileged action?

No user interaction is required. When pg_partman_bgw subsequently creates a child partition, it executes the stored value using the worker's role privileges; the configuration can also persist and re-establish elevated access on later maintenance ticks.

4

What should be done if an immediate upgrade is not possible?

Restrict or remove partman_user INSERT and UPDATE access for untrusted roles, and inspect writable part_config.time_encoder values for unexpected SQL rather than expected function names. Also review the privileges assigned to pg_partman_bgw, since its default role is PostgreSQL superuser.

5

How can administrators determine whether compromise may already have occurred?

Review part_config records, especially time_encoder values for text- or UUID-keyed partition sets, for injected SQL. Because successful exploitation can lead to database-wide compromise and operating-system command execution as the PostgreSQL service account, suspicious values should be treated as evidence requiring broader database and host investigation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203