Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain partman_user INSERT/UPDATE role
-
DeliveryStore malicious SQL in part_config.time_encoder
-
ExploitBGW executes payload on maintenance tick
-
ExecutionRun SQL as superuser role
-
PersistPersist config row for repeated re-escalation
-
ImpactOS command execution as PostgreSQL service account
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 (1) an authenticated database role holding the documented partman_user INSERT/UPDATE privileges on part_config, (2) a partition set keyed by text or UUID whose time_encoder value is consulted during child-partition creation, and (3) pg_partman_bgw.role configured as a superuser (the pre-5.5.0 documented default, e.g. 'postgres'). Exploitation is limited to attackers who already possess the partman_user grants and only triggers when the pg_partman_bgw background worker runs maintenance; deployments that already set pg_partman_bgw.role to a non-superuser or run without the BGW substantially reduce impact. No end-user interaction is needed - the worker executes the stored SQL automatically on maintenance ticks. |
| Impact | This is a genuine high-priority vulnerability, not a high-CVSS-but-low-real-risk case. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.9) is well-supported by the description: a low-privilege authenticated role (holding the documented partman_user INSERT/UPDATE grants) can store attacker-controlled SQL in the part_config.time_encoder text column, which pg_partman_bgw later executes with pg_partman_bgw.role privileges - which default to PostgreSQL superuser. That privilege boundary crossing justifies Scope:Changed and the full C:H/I:H/A:H, and the outcome (database-wide compromise plus OS command execution as the PostgreSQL service account) is credible. Confirming signals: vendor GHSA advisory, fix commit, and 5.5.0 release all present; the fix itself changes the BGW role GUC default away from superuser, corroborating the root cause. Weakening/limiting signals: no EPSS score, no CISA KEV listing, and no public POC were provided, so there is no evidence of active or automatable mass exploitation - exploitation is a persistent, insider-style privilege escalation requiring pre-existing partman_user grants and a text-/UUID-keyed partition set processed by a superuser-configured background worker. Net: treat as an urgent patch/config-hardening item wherever pg_partman runs its BGW as superuser (the pre-5.5.0 default), while recognizing exploitation requires an already-authenticated database role. |
| Exploit ScenarioDerived | An attacker who holds (or compromises) a database role with the documented partman_user INSERT/UPDATE privileges updates the part_config.time_encoder value for a text- or UUID-keyed partition set, storing arbitrary SQL instead of a function name. On the next maintenance tick, pg_partman_bgw creates a child partition and executes that stored SQL with its configured role - by default a PostgreSQL superuser - yielding database-wide compromise and OS command execution as the PostgreSQL service account. No public exploit code was identified at time of analysis, but the config row persists and re-triggers elevated execution on subsequent maintenance runs. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 18, 2026
SQL injection in the pg_partman PostgreSQL extension before version 5.5.0 lets an authenticated database role that holds the documented partman_user INSERT/UPDATE privileges on the part_config table store SQL text in the writable time_encoder column instead of a legitimate function name. When the pg_partman_bgw background worker next creates a child partition for a text- or UUID-keyed set, that stored SQL is interpolated into a dynamically executed SELECT and runs with the privileges of pg_partman_bgw.role, which the pre-5.5.0 documentation defaults to a superuser such as 'postgres'; because the payload persists in the configuration row, elevated access can be re-established on subsequent maintenance ticks and can lead to database-wide compromise and operating-system command execution as the PostgreSQL service account. The issue is rated CVSS 9.9 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) and is fixed in 5.5.0; no public exploit identified at time of analysis, and exploitation requires an attacker to already possess partman_user grants plus a deployment where the background worker runs as a superuser.
RemediationAI
Vendor-released patch: 5.5.0 - upgrade pg_partman to 5.5.0 or later, applying the fix commit ba9405542acf24dd881845b935cab8b165854361 and following advisory GHSA-742w-3j7c-qwvp and the release notes at https://github.com/pgpartman/pg_partman/releases/tag/v5.5.0. Be aware of the documented breaking change in 5.5.0: the default for the pg_partman_bgw.role GUC is now the non-superuser role partman_maintainer, so if the parameter was previously unset the background worker will stop running successfully and throw errors until that role exists and has the required privileges on all partman objects and on every pg_partman-managed partitioned table (typically by granting each table owner role to partman_maintainer, e.g. GRANT table_owner_alpha TO partman_maintainer). Two mitigations can be applied even before upgrading: explicitly set pg_partman_bgw.role to a non-superuser role with the needed privileges - this neutralizes the privilege-escalation leg of the chain, but the worker will then fail any set whose objects the role cannot modify - and revoke INSERT/UPDATE on part_config and part_config_sub from roles that do not genuinely need partman_user capabilities, at the cost of those roles no longer being able to configure partition sets. Running without the background worker (install with NO_BGW=1 and invoke run_maintenance() from an external scheduler as a non-superuser) removes the automatic execution trigger entirely, at the trade-off of losing built-in automated maintenance and requiring external job scheduling. Once on 5.5.0, enable Row Level Security policies on part_config and part_config_sub using the new maintenance_role column to restrict each role to the partition sets it owns; note this RLS option requires 5.5 because the supporting column does not exist in earlier versions. Finally, audit existing part_config rows for time_encoder values that are not legitimate function names, as a persisted payload survives the upgrade.
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 manages PostgreSQL declarative partitioned tables by time or ID and keeps its per-set configuration in the part_config table. The vulnerable path is create_partition_time(), which resolves the time-to-partition mapping through an encoder/decoder abstraction driven by the part_config.time_encoder text column; prior to 5.5.0 that value was interpolated directly into a dynamically constructed SELECT statement without identifier quoting, a classic CWE-89 SQL injection sink. Because the column is writable by the documented partman_user role (which is granted INSERT/UPDATE on part_config), a lower-privileged role can substitute arbitrary SQL for what should be a function name, and the malicious text is executed in the context of the pg_partman_bgw background worker rather than the attacker's own session. The exploitation conditions are narrow but the blast radius is not: it requires (1) an authenticated role holding those partman_user grants, (2) a partition set keyed by text or UUID whose time_encoder is consulted during child-partition creation, and (3) pg_partman_bgw.role configured as a superuser, which was the documented default before 5.5.0. The release notes for 5.5.0 also fix a cluster of related SQL injection/privilege escalation flaws in the same code paths - CVE-2026-61817 and CVE-2026-61818 (time encoder/decoder functions), CVE-2026-61819 (pg_jobmon extension), CVE-2026-61820 (template table property inheritance) and CVE-2026-61821 (retention schema ownership takeover) - and add a maintenance_role column to support Row Level Security on part_config and part_config_sub, indicating a deliberate hardening of the extension's trust boundaries around the configuration tables and background worker.
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:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Low-privilege authenticated partman_user (PR:L) injects SQL executed by the superuser-default BGW, crossing a privilege boundary (S:C) for full C/I/A including OS command execution.
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, 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.
Articles & Coverage 2
Technical POC Analysis
The vulnerable function is createpartitiontime() in pgpartman before 5.5.0.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
The pg_partman PostgreSQL extension (all versions before 5.5.0) contains a critical flaw that lets an ordinary database account with routine partition-maintenance permissions escalate to full database superuser and from there run operating-system commands as the PostgreSQL service account. Because the malicious configuration is stored in a table and re-executed on later maintenance cycles, an attacker can silently re-establish control of the database long after the initial change, exposing every database on the server and any system that depends on it. Leadership should care because a low-privilege application, reporting, or contractor account becomes a credible route to enterprise-wide data compromise and host-level access.
No vendor-released patch confirmed in the supplied advisory data, so apply interim mitigations: revoke INSERT/UPDATE on the part_config table from all non-owner roles (including documented partman_user grants), set pg_partman_bgw.role to a least-privileged non-superuser account instead of a superuser such as 'postgres', restrict network and role access to the database to trusted accounts, and monitor part_config.time_encoder for unexpected values; apply vendor patch (pg_partman 5.5.0) as soon as it is confirmed available.
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-83418
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB