Skip to main content

CVE-2026-61781: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in pgpartman pg_partman

0
Critical
VulnerabilityCVE-2026-61781cvecve-2026-61781cwe-89cwe-269
Published: 09/18/2026 (09/18/2026, 19:44:21 UTC)
Source: CVE Database V5
Vendor/Project: pgpartman
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Affected software

pgpartman

pg_partman

Affected versions
<5.5.0
GitHub Actionsmore threats →ai
pgpartman/pg_partman
pkg:github/pgpartman/pg_partman
Affected versions
<5.5.0

Run 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

AILast updated: 09/18/2026, 20:03:00 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses