Executive brief
pg_partman is a PostgreSQL extension that automates the creation and management of partitioned tables. Prior to version 5.5.0, a malicious database user with partman_user access can deliberately trigger an exception during partition maintenance, causing the maintenance process to abort and skip all remaining partition sets. Repeated abuse prevents legitimate partition tables from being maintained, leading to database dysfunction and potential data loss.
Technical details
The vulnerability exists in the run_maintenance() function, which processes multiple partition sets from the part_config table in a loop. Exception handling was placed outside the loop, so any exception immediately terminates processing and skips remaining partition sets. An authenticated attacker with partman_user role can insert a row with a low maintenance_order value that reliably raises an exception, causing run_maintenance() to fail before processing legitimate partitions. The fix in 5.5.0 moves exception handling inside the loop to catch errors per partition set and continue processing.
Affected products
- pgpartman pg_partman before 5.5.0
Timeline
- 2026-09-18: disclosed
- 2026-07-22: patched: version 5.5.0 released