Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain partman_user role on shared PostgreSQL
-
DeliveryStore SQL payload in part_config time_encoder/decoder
-
ExploitBGW maintenance processes text/UUID-keyed set
-
ExecutionInjected SQL runs as superuser BGW role
-
ImpactDatabase compromise and OS command execution as 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 an authenticated role holding the documented partman_user privileges (write access to part_config), so it is not remotely unauthenticated. Full escalation to superuser depends on the pg_partman_bgw.role GUC being set to a superuser role - historically the documented default before 5.5.0, which now defaults to a non-superuser 'partman_maintainer' - and on the affected partition set being text- or UUID-keyed so background-worker maintenance re-evaluates the poisoned time_encoder/decoder value. Without a superuser BGW the injected SQL still runs, but only with the invoking operation's privileges, limiting impact. Multi-tenant deployments where multiple roles use pg_partman are the realistic exposure; single-owner installs with a non-superuser maintainer role are largely unaffected. |
| Impact | This is a genuine high-priority vulnerability, though not the top-tier of its batch. The vendor CVSS of 8.5 (AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H) is defensible: it is network-reachable but requires a legitimate role holding documented partman_user privileges (PR:L), and AC:H reflects the specific preconditions for the superuser escalation path - the pg_partman_bgw background worker must be configured to run as a superuser role (historically the documented default) and the poisoned partition set must be text- or UUID-keyed so BGW maintenance re-processes it. The scope-change and full C/I/A follow from the payload executing with the BGW's default-superuser privileges, enabling database-wide compromise and OS command execution as the PostgreSQL service account. No EPSS score, no CISA KEV listing, and no public exploit code are present in the inputs, so exploitation is theoretical rather than observed; this is a fix-during-maintenance-window item rather than an emergency, but the privesc-to-superuser and OS-command-execution outcome makes it a firm priority for any multi-tenant or shared PostgreSQL deployment. Note this CVE is the broadest of the encoder/decoder trio (61781/61817/61818): 61781 is the pure AC:L BGW-superuser path scored 9.9, 61818 is the non-BGW confused-deputy path, while 61817 spans five functions and includes the AC:H BGW text/UUID path. |
| Exploit ScenarioDerived | An attacker with partman_user privileges (e.g., a tenant DBA in a shared PostgreSQL environment) updates the writable part_config.time_encoder/decoder column for a text- or UUID-keyed partition set, storing crafted SQL instead of a decoder function name. On the next pg_partman_bgw maintenance tick - or when any of run_maintenance()/show_partitions()/show_partition_info()/undo_partition()/partition_data_time() touches the value - the injected SQL executes with the background worker's privileges, which by default is a PostgreSQL superuser, yielding database-wide compromise and OS command execution as the service account. No public exploit code was 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 prior to 5.5.0 allows an authenticated PostgreSQL role holding the documented partman_user privileges to plant arbitrary SQL in the writable part_config.time_dncoder column and have it executed when routine maintenance or partition-inspection functions later interpolate that value into dynamic SQL. Because the injected statement runs with the privileges of the invoking operation, deployments whose pg_partman_bgw.role GUC is still pointed at a superuser role (the historical default before 5.5.0) can be escalated to database-wide compromise and operating-system command execution as the PostgreSQL service account, and the poisoned configuration row can re-establish elevated access on subsequent background-worker ticks. Exploitation requires write access to part_config and is most realistic in multi-tenant instances where several roles share pg_partman, and no public exploit code was identified at time of analysis; version 5.5.0 fixes the issue. The assessed CVSS is 8.5 (AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H), reflecting authenticated access and a high-complexity, scope-changing path rather than a remotely unauthenticated attack.
RemediationAI
Vendor-released patch: upgrade pg_partman to 5.5.0 (release notes: https://github.com/pgpartman/pg_partman/releases/tag/v5.5.0; fix commit ba9405542acf24dd881845b935cab8b165854361; advisory GHSA-gmw2-52wc-258g) and run ALTER EXTENSION pg_partman UPDATE. Note that 5.5.0 is a breaking release: the pg_partman_bgw.role GUC now defaults to the arbitrary non-superuser name 'partman_maintainer', so if that parameter was previously unset the background worker will fail with errors until you either create that role or explicitly set the GUC. Before or alongside the upgrade, move the maintainer off superuser by creating a dedicated non-superuser role, setting pg_partman_bgw.role to it, and granting it the owner roles of every pg_partman-managed partitioned table (for example GRANT table_owner_alpha TO partman_maintainer), which lets maintenance continue while removing the privilege-escalation payoff; the vendor documents that this non-superuser migration can be performed even before upgrading if the mitigation is needed earlier. Where the upgrade cannot be applied immediately, compensating controls are to revoke INSERT/UPDATE/DELETE on part_config and part_config_sub from all but a tightly controlled administrative role (trade-off: partman_user roles lose the ability to define or tune their own partition sets), to audit part_config.time_dncoder, time_encoder and related columns for values that are not known-safe function names and correct any poisoned rows, and to ensure the background worker and any scheduled maintenance execute as a non-superuser with only the table-ownership grants it needs (trade-off: some administrative maintenance paths that assume superuser will need reworking). Row-level security on the configuration tables via the maintenance_role column added in 5.5.0 is recommended for multi-tenant instances to restrict which role can maintain which partition set, but requires the extension upgrade since that column does not exist in earlier versions; RLS policy enforcement alone is not a substitute for 5.5.0 because the unquoted interpolation is only removed by the patch.
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-keyed partitioned tables, typically driven by the pg_partman_bgw background worker and by stored functions such as run_maintenance(), show_partitions(), show_partition_info(), undo_partition() and partition_data_time(). The root cause is CWE-89 (Improper Neutralization of Special Elements used in an SQL Command): these routines build dynamic SQL and interpolate the part_config.time_dncoder text value - intended to be a time encoder/decoder function name - directly into the statement as an identifier/value without identifier quoting or allow-list validation. Any role able to UPDATE part_config (the documented partman_user privilege set) can therefore store a SQL fragment instead of a function name, and that fragment is executed by whichever role later performs the operation, including the background worker. The attack path is highest where pg_partman_bgw.role was configured to a superuser (the documented default before 5.5.0), and where the affected partition set is text- or UUID-keyed so that background maintenance re-evaluates the poisoned encoder/decoder value. Post-exploitation, injected DDL/DML can create superuser-equivalent roles, read or modify arbitrary data, and, through untrusted procedural language or COPY/file facilities available to the PostgreSQL service account, execute operating-system commands; the persistence of the poisoned row across maintenance ticks makes the access durable until the configuration is cleaned. The affected CPE range is cpe:2.3:a:pgpartman:pg_partman:* - all releases before 5.5.0. The 5.5.0 changelog groups this flaw with sibling injection/privilege-escalation issues CVE-2026-61781 and CVE-2026-61818 (time encoder/decoder path), CVE-2026-61819 (pg_jobmon), CVE-2026-61820 (template table inheritance), CVE-2026-61821 (retention schema ownership) and CVE-2026-61822, all addressed in the same release.
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), AC:H for the superuser-BGW plus text/UUID-keyed-set preconditions, scope change and full C/I/A from superuser-level SQL and 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, run_maintenance(), show_partitions(), show_partition_info(), undo_partition(), and partition_data_time() interpolate the writable part_config.time_dncoder text value without identifier quoting into dynamic SQL. A role with the documented partman_user privileges can store SQL rather than a decoder function name. When an affected operation later uses the poisoned value, including pg_partman_bgw maintenance for a text- or UUID-keyed set, the SQL executes with the operation's privileges, which can be the default PostgreSQL superuser background-worker role. The persistent row can restore elevated access on later 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 1
Technical POC Analysis
CWE-89 (SQL injection).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A high-severity flaw in pg_partman, the PostgreSQL partition-management extension, allows a database role that already holds the extension's standard maintenance privileges to plant malicious SQL in a writable configuration column that is later executed during routine partition maintenance - potentially with full database rights and operating-system command execution as the PostgreSQL service account. Because the poisoned configuration row persists and can silently re-establish elevated access on subsequent background-worker cycles, affected organizations face a durable, difficult-to-detect compromise path rather than a single isolated event. Leadership should prioritize this wherever pg_partman is deployed on shared or multi-tenant database instances, where several teams or customers hold roles that can write to the extension's configuration table.
Apply vendor patch - upgrade pg_partman to version 5.5.0, the fix version identified in the advisory. Until every instance is upgraded: repoint pg_partman_bgw.role away from any superuser role; revoke INSERT/UPDATE on part_config from all but the minimum necessary trusted roles; audit and clean the part_config table (including time_dncoder) for injected or unexpected values; and alert on any modification to part_config so re-poisoning attempts are detected.
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-83430
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB