CVE-2026-61781: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in pgpartman pg_partman
pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, create_partition_time() reads the writable part_config.time_encoder text value and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with the documented partman_user INSERT and UPDATE privileges can store SQL rather than a function name. When pg_partman_bgw later creates a child partition for a text- or UUID-keyed set, the worker executes the stored SQL with pg_partman_bgw.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.
AI Analysis
Technical Summary
The vulnerability in pg_partman versions before 5.5.0 involves improper neutralization of special elements in an SQL command (CWE-89). Specifically, the create_partition_time() function reads the part_config.time_encoder text value and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with partman_user INSERT and UPDATE privileges can store malicious SQL instead of a function name. When the pg_partman background worker creates a child partition for text- or UUID-keyed sets, it executes this stored SQL with superuser privileges, enabling persistent privilege escalation and potential full database and OS compromise. The issue is resolved in version 5.5.0.
Potential Impact
Successful exploitation allows a user with limited privileges (partman_user role) to execute arbitrary SQL commands with PostgreSQL superuser privileges via the background worker process. This can lead to complete database compromise and execution of operating system commands as the PostgreSQL service account, posing a critical risk to confidentiality, integrity, and availability of the database and underlying system.
Mitigation Recommendations
Upgrade pg_partman to version 5.5.0 or later, where this vulnerability is fixed. No other mitigations are indicated by the vendor advisory. Patch status is confirmed fixed in 5.5.0.
CVE-2026-61781: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in pgpartman pg_partman
Description
pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, create_partition_time() reads the writable part_config.time_encoder text value and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with the documented partman_user INSERT and UPDATE privileges can store SQL rather than a function name. When pg_partman_bgw later creates a child partition for a text- or UUID-keyed set, the worker executes the stored SQL with pg_partman_bgw.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.
CVSS v3.1
Score 9.9critical
Affected software
pgpartman
pg_partman
pkg:github/pgpartman/pg_partmanRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in pg_partman versions before 5.5.0 involves improper neutralization of special elements in an SQL command (CWE-89). Specifically, the create_partition_time() function reads the part_config.time_encoder text value and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with partman_user INSERT and UPDATE privileges can store malicious SQL instead of a function name. When the pg_partman background worker creates a child partition for text- or UUID-keyed sets, it executes this stored SQL with superuser privileges, enabling persistent privilege escalation and potential full database and OS compromise. The issue is resolved in version 5.5.0.
Potential Impact
Successful exploitation allows a user with limited privileges (partman_user role) to execute arbitrary SQL commands with PostgreSQL superuser privileges via the background worker process. This can lead to complete database compromise and execution of operating system commands as the PostgreSQL service account, posing a critical risk to confidentiality, integrity, and availability of the database and underlying system.
Mitigation Recommendations
Upgrade pg_partman to version 5.5.0 or later, where this vulnerability is fixed. No other mitigations are indicated by the vendor advisory. Patch status is confirmed fixed in 5.5.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-10T20:06:05.616Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6aad953b55bf5e2cf577b89d
Added to database: 09/18/2026, 19:47:07 UTC
Last enriched: 09/18/2026, 20:03:00 UTC
Last updated: 09/19/2026, 01:59:48 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.