Skip to main content

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

0
High
VulnerabilityCVE-2026-61820cvecve-2026-61820cwe-89
Published: 09/18/2026 (09/18/2026, 19:49:10 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, inherit_template_properties() manually surrounds primary-key column names from pg_attribute.attname with double quotes without escaping embedded double-quote characters. A partman_user who owns a template table can create a crafted column name that breaks out of the generated ALTER TABLE ADD PRIMARY KEY identifier when the background worker applies the key to a child partition. The generated SQL then 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 crafted catalog identifier persists until removed and can trigger again during later partition creation. This issue is fixed in version 5.5.0.

CVSS v3.1

Score 8.5high

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/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:17:25 UTC

Technical Analysis

The vulnerability in pg_partman versions before 5.5.0 stems from the inherit_template_properties() function, which encloses primary-key column names in double quotes without escaping embedded double-quote characters. A malicious partman_user owning a template table can craft a column name that breaks out of the ALTER TABLE ADD PRIMARY KEY SQL command generated during background worker operations. This leads to execution of arbitrary SQL with the privileges of pg_partman_bgw.role, which defaults to PostgreSQL superuser. The injected malicious SQL can cause database-wide compromise and allow execution of operating system commands as the PostgreSQL service account. The crafted catalog identifier remains persistent until removed and can be triggered again during subsequent partition creations. The vulnerability is fixed in version 5.5.0.

Potential Impact

Successful exploitation allows an attacker with limited privileges (partman_user owning a template table) to execute arbitrary SQL commands with superuser privileges, resulting in full database compromise and potential operating system command execution as the PostgreSQL service account. The vulnerability persists until the malicious catalog identifier is removed and can be re-triggered during future partition operations.

Mitigation Recommendations

Upgrade pg_partman to version 5.5.0 or later, where this vulnerability is fixed. No other mitigation or temporary workaround is indicated. Removing any crafted malicious catalog identifiers may be necessary to prevent re-triggering after upgrade.

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:17:57.992Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6aad98c355bf5e2cf57b8896

Added to database: 09/18/2026, 20:02:11 UTC

Last enriched: 09/18/2026, 20:17:25 UTC

Last updated: 09/18/2026, 23:50:26 UTC

Views: 4

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