Skip to main content

pg_partman CVE-2026-61819

| EUVDEUVD-2026-83434 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
    Authenticate as partman_user
  2. Delivery
    Create parent table with quote-injected SQL name
  3. Exploit
    Enable/rely on jobmon exception path
  4. Execution
    BGW maintenance tick calls pg_jobmon.add_job()
  5. Persist
    Injected SQL runs as superuser
  6. Impact
    Database 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 ALL of: (1) the pg_jobmon extension installed in the database; (2) part_config.jobmon set to true for the target partition set; (3) an attacker who is a partman_user permitted to create and name parent tables; (4) execution reaching one of the affected exception handlers (an error path in the pg_partman functions that call pg_jobmon.add_job()); and (5) for full superuser/OS impact, pg_partman_bgw.role resolving to a PostgreSQL superuser - the documented default before 5.5.0. Limiting factors: the exception path must actually fire, and deployments that already set pg_partman_bgw.role to a non-superuser role (or do not use pg_jobmon) sharply reduce or eliminate the escalation, making this primarily a threat to multi-tenant clusters using jobmon with a superuser BGW.

Impact

This is a genuine privilege-escalation risk but conditional, not a drop-everything remote-unauth emergency. The CVSS 3.1 vector (AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H, base 8.5) correctly encodes the tension: network-reachable and high-impact (scope change to superuser/OS), but gated by AC:H and PR:L. The AC:H is well-justified because exploitation requires a stacked precondition chain - pg_jobmon must be installed, part_config.jobmon must be true, one of the affected exception handlers must actually be triggered, and pg_partman_bgw.role must resolve to a superuser (which was the documented default before 5.5.0). PR:L is consistent with the description: the attacker must already be a partman_user able to create/name a parent table. No EPSS score, no CISA KEV listing, and no public exploit code are present in the input, so there is no evidence of active exploitation - treat this as a patch-in-normal-cycle-but-prioritize-if-multi-tenant issue rather than an actively-weaponized one. The C:H/I:H/A:H is credible ONLY when the BGW runs as superuser; environments that already ran the BGW under a non-superuser role see far lower real impact, so the headline 8.5 overstates risk for hardened deployments. Signals are internally consistent; no contradiction between the vector and the description.

Exploit ScenarioDerived

A tenant holding partman_user rights creates a partitioned parent table whose name embeds a single quote plus attacker SQL (e.g. a name that terminates the add_job() string literal). When a later maintenance tick hits an exception path and pg_partman_bgw calls pg_jobmon.add_job() with the name inlined, the injected SQL executes with the BGW role - superuser by default - yielding database-wide compromise and OS command execution as the PostgreSQL service account. No public exploit code is identified in the provided intelligence, though the vendor advisory (GHSA-gv5h-j2cm-rhc3) and fix commit describe the mechanism precisely.

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 before 5.5.0 allows an authenticated low-privileged partman_user to escalate to PostgreSQL superuser and execute operating-system commands as the PostgreSQL service account. The flaw only fires when pg_jobmon is installed, part_config.jobmon is true for the target partition set, and an affected exception handler in a pg_partman function actually runs; the injected SQL then executes with the privileges of pg_partman_bgw.role, which defaulted to a PostgreSQL superuser prior to 5.5.0. The malicious parent-table name is stored persistently in part_config, so the escalation can re-trigger on later background-worker maintenance ticks; exploitation is conditional and most dangerous in multi-tenant clusters that use jobmon with a superuser background worker, and no public exploit code was identified at time of analysis. Fixed in 5.5.0.

RemediationAI

Upgrade pg_partman to 5.5.0, which is the vendor-released patch for this issue; the fix is distributed through the v5.5.0 release and commit ba940554, with details in advisory GHSA-gv5h-j2cm-rhc3. Note the 5.5.0 breaking change: the default pg_partman_bgw.role is now the non-superuser value partman_maintainer, so if that parameter was never explicitly set, the background worker will fail until the role exists and has been granted the necessary privileges - for example GRANT each partition-set owner role TO partman_maintainer - which is required for maintenance to run. As a mitigation that can be applied before upgrading, immediately set pg_partman_bgw.role to a dedicated non-superuser account with full access to partman objects and the managed partitioned tables; the trade-off is that the BGW will log errors and stop performing maintenance until those privileges are granted, but it removes the superuser escalation target. Alternatively, eliminate the vulnerable code path by setting part_config.jobmon to false for every partition set (or removing pg_jobmon), at the cost of losing jobmon maintenance logging. Also restrict which roles may create and name parent tables as partman_user, and enable Row Level Security on part_config and part_config_sub to limit cross-tenant maintenance using the maintenance_role column - note RLS enforcement requires 5.5.0, since that column was added in that version. Verifying that no partition set has a jobmon=true configuration and that pg_partman_bgw.role is non-superuser substantially reduces residual risk in the interim.

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 maintenance of time- or ID-based partitioned tables, optionally logging maintenance jobs to the third-party pg_jobmon extension via pg_jobmon.add_job(). The underlying weakness is CWE-89 (SQL injection): multiple pg_partman functions build the add_job() call as a dynamically constructed SQL string and interpolate the parent table name (p_parent_table) verbatim inside a string literal, rather than parameterizing or properly escaping it. A partman_user who is allowed to create parent tables can therefore choose a table name containing a single quote that terminates the literal and appends attacker-controlled SQL; the payload is only evaluated when execution reaches one of the affected exception handlers - an error path that invokes add_job() - so the injection is conditional on that path firing. Because the injected statement runs in the context of the background worker's configured role, and the documented default for pg_partman_bgw.role before 5.5.0 was a superuser (e.g. postgres), successful exploitation crosses a privilege boundary (CVSS scope change) and yields database-wide compromise plus OS command execution under the PostgreSQL service account. The CVSS 3.1 vector AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H reflects remote reachability, high attack complexity and low required privileges, and is consistent with the requirement that the attacker be a partman_user with parent-table creation rights. The 5.5.0 commit (ba940554) fixes this alongside related SQL-injection/privilege-escalation issues (CVE-2026-61781, CVE-2026-61817, CVE-2026-61818, CVE-2026-61820) and hardens the background worker by changing the default pg_partman_bgw.role to a non-superuser value.

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

AC:H for the stacked pg_jobmon+jobmon=true+exception-path+superuser-BGW preconditions; PR:L as an authenticated partman_user; S:C/C:H/I:H/A:H because injected SQL runs as superuser enabling 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:50 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, when pg_jobmon is installed and part_config.jobmon is true, exception handlers in multiple pg_partman functions place p_parent_table verbatim inside a SQL string literal used to call pg_jobmon.add_job(). A partman_user can create a parent-table name containing a single quote that terminates the literal and injects SQL when an affected exception path runs. If pg_partman_bgw reaches that path, the injected SQL 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 persistent part_config row can trigger the escalation again on later maintenance ticks. 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 low-privileged database account to escalate to full database superuser and execute operating-system commands as the PostgreSQL service account. Organizations running pg_partman in shared or multi-tenant clusters - especially where pg_jobmon is installed with jobmon enabled and a superuser background worker - face a realistic path from routine application access to control of the database host, and the trigger persists in configuration so it can re-fire on later background maintenance cycles. No public exploit code has been identified at time of analysis, so the immediate priority is configuration review of affected clusters and disciplined upgrade planning rather than incident response.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis in the tracking data (the advisory description cites 5.5.0 as the fix, so validate availability for your distribution and apply it where obtainable). Interim mitigations: disable pg_jobmon or set part_config.jobmon to false for all partition sets where it is not required; run pg_partman_bgw under a dedicated non-superuser role instead of the pre-5.5.0 superuser default; restrict and review privileges of any partman_user-class account and reduce the number of principals holding it; revoke CREATE privileges on schemas containing partitioned tables; audit part_config parent-table entries for tampering; restrict network reachability to the database; and log or alert on exception-handler and background-worker activity for early detection.

Threat Intelligence Overview

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