Skip to main content

pg_partman CVE-2026-61817

| EUVDEUVD-2026-83430 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
    Obtain partman_user role on shared PostgreSQL
  2. Delivery
    Store SQL payload in part_config time_encoder/decoder
  3. Exploit
    BGW maintenance processes text/UUID-keyed set
  4. Execution
    Injected SQL runs as superuser BGW role
  5. Impact
    Database 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.

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 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

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-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

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), 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.

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:48 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, 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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.6%
Top 54% exploitable
Prevalence
Medium
popular PostgreSQL partitioning extension, offered on RDS/Azure/Supabase/Google
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