CVE-2026-61819: 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, when pg_jobmon is installed and part_config.jobmon is true, exception handlers in multiple pg_partman functions place p_parent_table verbatim inside a SQL string literal used to call pg_jobmon.add_job(). A partman_user can create a parent-table name containing a single quote that terminates the literal and injects SQL when an affected exception path runs. If pg_partman_bgw reaches that path, the injected SQL executes with pg_partman_bgw.role privileges, which default to PostgreSQL superuser, permitting database-wide compromise and operating-system command execution as the PostgreSQL service account. The persistent part_config row can trigger the escalation again on later maintenance ticks. This issue is fixed in version 5.5.0.
AI Analysis
Technical Summary
The vulnerability arises from improper neutralization of special elements in SQL commands (CWE-89) within pg_partman functions that call pg_jobmon.add_job(). Specifically, the parent table name (p_parent_table) is embedded verbatim inside a SQL string literal in exception handlers when part_config.jobmon is true. If the parent table name contains a single quote, it terminates the string literal and allows SQL injection. The injected SQL executes with the privileges of pg_partman_bgw.role, which defaults to PostgreSQL superuser, leading to database-wide compromise and possible OS command execution as the PostgreSQL service account. This vulnerability is persistent due to the part_config row and can be triggered repeatedly on maintenance ticks. The issue is resolved in version 5.5.0 of pg_partman.
Potential Impact
Successful exploitation allows an attacker with partman_user privileges to execute arbitrary SQL commands with superuser privileges, resulting in full database compromise and potential execution of operating system commands as the PostgreSQL service account. This can lead to complete control over the database and underlying system.
Mitigation Recommendations
Upgrade pg_partman to version 5.5.0 or later, where this SQL injection vulnerability is fixed. No other mitigations are specified. Patch status is confirmed as fixed in version 5.5.0.
CVE-2026-61819: 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, when pg_jobmon is installed and part_config.jobmon is true, exception handlers in multiple pg_partman functions place p_parent_table verbatim inside a SQL string literal used to call pg_jobmon.add_job(). A partman_user can create a parent-table name containing a single quote that terminates the literal and injects SQL when an affected exception path runs. If pg_partman_bgw reaches that path, the injected SQL executes with pg_partman_bgw.role privileges, which default to PostgreSQL superuser, permitting database-wide compromise and operating-system command execution as the PostgreSQL service account. The persistent part_config row can trigger the escalation again on later maintenance ticks. This issue is fixed in version 5.5.0.
CVSS v3.1
Score 8.5high
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.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from improper neutralization of special elements in SQL commands (CWE-89) within pg_partman functions that call pg_jobmon.add_job(). Specifically, the parent table name (p_parent_table) is embedded verbatim inside a SQL string literal in exception handlers when part_config.jobmon is true. If the parent table name contains a single quote, it terminates the string literal and allows SQL injection. The injected SQL executes with the privileges of pg_partman_bgw.role, which defaults to PostgreSQL superuser, leading to database-wide compromise and possible OS command execution as the PostgreSQL service account. This vulnerability is persistent due to the part_config row and can be triggered repeatedly on maintenance ticks. The issue is resolved in version 5.5.0 of pg_partman.
Potential Impact
Successful exploitation allows an attacker with partman_user privileges to execute arbitrary SQL commands with superuser privileges, resulting in full database compromise and potential execution of operating system commands as the PostgreSQL service account. This can lead to complete control over the database and underlying system.
Mitigation Recommendations
Upgrade pg_partman to version 5.5.0 or later, where this SQL injection vulnerability is fixed. No other mitigations are specified. Patch status is confirmed as fixed in version 5.5.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-10T20:17:57.992Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6aad98c355bf5e2cf57b8895
Added to database: 09/18/2026, 20:02:11 UTC
Last enriched: 09/18/2026, 20:17:31 UTC
Last updated: 09/19/2026, 01:09:18 UTC
Views: 5
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.