CVE-2026-61820 pg_partman privilege escalation via SQL injection when inheriting template properties
A SQL injection in pg_partman allows a partman_user to execute arbitrary SQL as superuser via crafted column names, leading to full database and OS compromise.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-61820?
CVE-2026-61820 is a high-severity SQL injection vulnerability in pgpartman pg_partman, published on 18 Sep 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, inherit_template_properties() manually surrounds primary-key column names from pg_attribute.attname with double quotes without escaping embedded double-quote characters. A partman_user who owns a template table can create a crafted column name that breaks out of the generated ALTER TABLE ADD PRIMARY KEY identifier when the background worker applies the key to a child partition. The generated SQL then 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 crafted catalog identifier persists until removed and can trigger again during later partition creation. This issue is fixed in version 5.5.0.
Weakness: CWE-89
Which versions are affected by CVE-2026-61820?
How do I fix CVE-2026-61820?
Upgrade to a fixed version.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2026-61820 being exploited?
There is no known exploitation of CVE-2026-61820 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2026-61820, ECHO-18af-f647-c2f7, GHSA-xqxh-6hh3-974m, UBUNTU-CVE-2026-61820.