Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as partman_user owning a template table
-
DeliveryCreate column with crafted double-quote identifier
-
ExploitBackground worker builds ADD PRIMARY KEY SQL
-
ExecutionInjected SQL runs with superuser BGW role
-
ImpactDatabase 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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.
Articles & Coverage 1
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
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
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
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
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
EUVD-2026-83433
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB