Skip to main content

pg_partman CVE-2026-61820

| EUVDEUVD-2026-83433 HIGH
SQL Injection (CWE-89)
2026-09-18 GitHub_M
8.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate as partman_user owning a template table
  2. Delivery
    Create column with crafted double-quote identifier
  3. Exploit
    Background worker builds ADD PRIMARY KEY SQL
  4. Execution
    Injected SQL runs with superuser BGW role
  5. Impact
    Database compromise and OS command execution

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires an authenticated PostgreSQL role with partman_user privileges that OWNS a template table (PR:L). Critically, the pg_partman background worker must be configured to run as a PostgreSQL superuser (pg_partman_bgw.role set to a superuser such as 'postgres' - the effective default in <5.5.0), otherwise the injected SQL executes only with the restricted role's rights and superuser/OS escalation does not occur. Exploitation is also gated on the background worker actually applying the primary key to a child partition (AC:H - attacker does not directly control this timing, though the crafted catalog identifier persists and re-triggers on later partition creation). Limiting factors: low-privilege authentication needed, template-table ownership needed, and a non-default hardened BGW role (non-superuser, as recommended in 5.5.0) neutralizes the privilege-escalation impact.

Impact

The CVSS 3.1 vector (AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H = 8.5 HIGH) describes an authenticated (PR:L) SQL-injection/privilege-escalation flaw whose real severity hinges on a specific deployment precondition: the pg_partman background worker running as a PostgreSQL superuser (pg_partman_bgw.role defaulting to superuser in <5.5.0 setups). When that condition holds, a low-privileged partman_user who owns a template table can inject SQL that the BGW executes with superuser rights, yielding database-wide compromise and OS command execution as the PostgreSQL service account - hence C:H/I:H/A:H and the scope change (S:C). The AC:H rating is well-justified: exploitation depends on the BGW being configured with a superuser role and on the crafted column name being applied during (attacker-uncontrolled) child-partition creation timing. There is no EPSS score, no CISA KEV listing, and no public POC in the provided data, so this is a real but not currently-weaponized priority - no public exploit identified at time of analysis. Signals are consistent rather than conflicting; the main caveat is that the 8.5 assumes the common-but-not-universal superuser-BGW configuration, so environments that already run the BGW as a restricted role face substantially lower risk.

Exploit ScenarioDerived

A tenant with partman_user privileges who owns a template table crafts a primary-key column name containing an unescaped double-quote that breaks out of the generated ALTER TABLE ADD PRIMARY KEY identifier. When the background worker (running as superuser by default) next creates a child partition and applies the primary key, the injected SQL executes with superuser privileges, allowing the attacker to escalate to full database control and run OS commands as the PostgreSQL service account. No public exploit code is identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 18, 2026

SQL injection in pg_partman before 5.5.0 allows an authenticated partman_user who owns a template table to escape the generated ALTER TABLE ADD PRIMARY KEY statement by placing a double-quote character in a column name, causing the background worker to run attacker-supplied SQL under the worker's role. Because pre-5.5.0 deployments effectively default pg_partman_bgw.role to a PostgreSQL superuser, successful exploitation yields database-wide compromise and operating-system command execution as the PostgreSQL service account, with the crafted catalog identifier persisting and re-triggering during later child-partition creation. Exploitation is gated on the background worker actually applying the primary key to a child partition (hence AC:H) and is neutralized entirely if the worker runs as a non-superuser role; no public exploit identified at time of analysis, and the flaw is fixed in 5.5.0 (CVSS 3.1 score 8.5).

RemediationAI

Vendor-released patch: 5.5.0 - upgrade pg_partman to 5.5.0 (see https://github.com/pgpartman/pg_partman/security/advisories/GHSA-xqxh-6hh3-974m and the release notes at https://github.com/pgpartman/pg_partman/releases/tag/v5.5.0, fix commit ba9405542acf24dd881845b935cab8b165854361), which corrects the identifier quoting and simultaneously changes the background worker GUC default to the non-superuser role partman_maintainer. Because that 5.5.0 default is a breaking change, if pg_partman_bgw.role was previously unset the worker will start failing unless a partman_maintainer role exists with the required privileges, so create that role (or another dedicated non-superuser role) and grant it the owner roles of every pg_partman-managed partition set; operators who must remediate before they can upgrade can do the equivalent today by explicitly setting pg_partman_bgw.role to a non-superuser role and reloading, which removes the superuser/OS escalation path even though the injection code itself remains unfixed. Residual work is required even after patching: inspect template-table columns in pg_attribute for attname values containing embedded quotes and remove or rename them, and identify/drop any child partitions that were created through injected DDL, since the crafted identifier persists in the catalog and can fire again during later partition creation. Supplementary hardening in 5.5.0 includes row-level-security support on part_config and part_config_sub through the new maintenance_role column, which lets administrators restrict which roles may run maintenance on others' partition sets; this is unavailable before 5.5.0 and, like all RLS-based controls, should be validated against existing automation because it can block legitimate maintenance if policies are too strict. Note that 5.5.0 also bundles fixes for several sibling SQL-injection privilege-escalation CVEs (CVE-2026-61781, CVE-2026-61817, CVE-2026-61818, CVE-2026-61819, CVE-2026-61821, CVE-2026-61822), so a single upgrade addresses more than this one issue.

Affected VersionsENISA

pg_partman < 5.5.0

Affected Packages

euvd pg_partman fix: 5.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

pg_partman is a PostgreSQL extension that automates creation and retention of time- or ID-based partitioned tables, and in affected releases its inherit_template_properties() routine copies primary-key column names from the system catalog pg_attribute.attname into a generated ALTER TABLE ... ADD PRIMARY KEY statement, manually surrounding each name with double quotes but never escaping embedded double-quote characters. That is classic CWE-89 improper neutralization of special elements in SQL, here applied to DDL identifier quoting rather than value quoting: a template-table owner can register a column whose attname contains a quote and thereby terminate the quoted identifier and append arbitrary SQL to the statement the maintenance background worker (pg_partman_bgw) later executes against a new child partition. The security-relevant amplifier is the GUC pg_partman_bgw.role, which in pre-5.5.0 configurations is typically left as a superuser such as postgres; the injected statement therefore runs with superuser rights, which is why the vector carries S:C (the vulnerable component executes code in a security context beyond the attacker's own) and C:H/I:H/A:H. The affected package corresponds to CPE cpe:2.3:a:pgpartman:pg_partman:*:*:*:*:*:*:*:* and the fix landed in the 5.5.0 commit ba9405542acf24dd881845b935cab8b165854361, which also changes the background worker's default role to the non-superuser partman_maintainer.

Know when PostgreSQL gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.5 HIGH
AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
vuln.today AI 8.5 HIGH

Authenticated partman_user (PR:L) injects via a catalog identifier applied by a default-superuser BGW (AC:H, timing/config dependent); superuser + OS command execution justifies S:C and full C:H/I:H/A:H.

3.1 AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 9.9 CRITICAL

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Sep 18, 2026 - 21:18 EUVD
CVE Published
Sep 18, 2026 - 19:49 cve.org
HIGH 8.5

DescriptionCVE.org

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.

Technical POC Analysis

Advisory: GHSA-xqxh-6hh3-974m.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A privilege-escalation flaw in pg_partman, the widely used PostgreSQL partition-management extension, can let a low-trust database role turn routine partition maintenance into full control of the database and the underlying server. Organizations running pg_partman versions before 5.5.0 are exposed wherever the background worker retains its default superuser identity, meaning a single unremoved quote character in a column name can be leveraged into operating-system command execution as the PostgreSQL service account and persistent re-triggering on future partition creation. Because the affected system typically underpins revenue, customer, or regulated data, leadership should treat the remediation window as short even though no public exploit code has been identified at time of analysis.

Business Impact: High
Compensating Controls

Apply vendor patch (upgrade to pg_partman 5.5.0 or later). Where upgrade cannot be completed immediately, configuring pg_partman_bgw.role to a non-superuser role neutralizes the flaw entirely, and restricting template-table ownership to trusted roles limits the attack surface.

Threat Intelligence Overview

EPSS Score
0.6%
Top 54% exploitable
Prevalence
Medium
popular PostgreSQL partitioning extension, available on RDS/Azure/Supabase but optional
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

43
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy