# CVE-2026-61781: pg_partman has privilege escalation through SQL injection in create_partition_time()

- Severity: Critical 9.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.57%, higher than 48% of CVEs (2026-12-01)
- Published: 2026-09-18T19:44:21.808Z
- Modified: 2026-09-23T18:12:04.247Z
- Weaknesses: CWE-89, CWE-269
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- pgpartman pg_partman: < 5.5.0

## References

- <https://github.com/pgpartman/pg_partman/security/advisories/GHSA-742w-3j7c-qwvp>
- <https://github.com/pgpartman/pg_partman/commit/ba9405542acf24dd881845b935cab8b165854361>
- <https://github.com/pgpartman/pg_partman/releases/tag/v5.5.0>

## Sources

- CVE List: [CVE-2026-61781](https://www.cve.org/CVERecord?id=CVE-2026-61781), CVE Terms of Use, modified 2026-09-18
- NVD: [CVE-2026-61781](https://nvd.nist.gov/vuln/detail/CVE-2026-61781), Public domain, modified 2026-09-23

---

Page: https://cve.day/CVE-2026-61781 · Whole record: https://cve.day/CVE-2026-61781.json · Rebuilt by cve.day 2026-11-25T22:59:39.665Z
