Skip to main content

pg_partman EUVDEUVD-2026-83418

| CVE-2026-61781 CRITICAL
SQL Injection (CWE-89)
2026-09-18 GitHub_M
9.9
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 INSERT/UPDATE role
  2. Delivery
    Store malicious SQL in part_config.time_encoder
  3. Exploit
    BGW executes payload on maintenance tick
  4. Execution
    Run SQL as superuser role
  5. Persist
    Persist config row for repeated re-escalation
  6. Impact
    OS 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
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 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

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

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

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/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
Low
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:44 cve.org
CRITICAL 9.9

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

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.6%
Top 54% exploitable
Prevalence
Medium
widely used PostgreSQL partitioning extension (RDS/Azure/GCP/Supabase) but not universally installed
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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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

51
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +50
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