# CVE-2022-1552: Privilege escalation in postgresql

> An attacker with object creation permissions can execute arbitrary SQL as a superuser due to insufficient privilege checks in maintenance commands.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Aug 2022
- **Updated:** 3 Aug 2024
- **Also known as:** ALPINE-CVE-2022-1552, ALSA-2022:4805, ALSA-2022:4807, AZL-10826, BIT-postgresql-2022-1552, CLEANSTART-2026-DL32115, CLSA-2022-1666192732, DEBIAN-CVE-2022-1552, DSA-5135-1, DSA-5136-1, ECHO-cee1-bf37-4229, GHSA-3f3c-74mp-823m, JLSEC-2026-37, MGASA-2022-0201, OESA-2022-2104, RHSA-2022:4771, RHSA-2022:4805, RHSA-2022:4807, RHSA-2022:4854, RHSA-2022:4855, RHSA-2022:4856, RHSA-2022:4857, RHSA-2022:4893, RHSA-2022:4894, RHSA-2022:4895, RHSA-2022:4913, RHSA-2022:4915, RHSA-2022:4929, RHSA-2022:5162, RLSA-2022:4771, RLSA-2022:4805, RLSA-2022:4807, RLSA-2022:4855, SUSE-SU-2022:1804-1, SUSE-SU-2022:1835-1, SUSE-SU-2022:1869-1, SUSE-SU-2022:1874-1, SUSE-SU-2022:1890-1, SUSE-SU-2022:1894-1, SUSE-SU-2022:1895-1, SUSE-SU-2022:1908-1, UBUNTU-CVE-2022-1552, USN-5440-1, USN-5676-1, openSUSE-SU-2024:12072-1, openSUSE-SU-2024:12073-1, openSUSE-SU-2024:12075-1, openSUSE-SU-2024:12076-1, openSUSE-SU-2024:12077-1

## What is CVE-2022-1552?

CVE-2022-1552 is a high-severity vulnerability in Postgresql Postgresql, published on 31 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

A flaw was found in PostgreSQL. There is an issue with incomplete efforts to operate safely when a privileged user is maintaining another user's objects. The Autovacuum, REINDEX, CREATE INDEX, REFRESH MATERIALIZED VIEW, CLUSTER, and pg_amcheck commands activated relevant protections too late or not at all during the process. This flaw allows an attacker with permission to create non-temporary objects in at least one schema to execute arbitrary SQL functions under a superuser identity.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), CWE-459 (Incomplete Cleanup)

## Which versions are affected by CVE-2022-1552?

1 open source package ship an affected version, including postgresql. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | From 10.0.0 | 10.21.0, 11.16.0, 12.11.0, 13.7.0, 14.3.0 |
| `pg_repack` | AlmaLinux:8 | All versions | 1.4.6-3.module_el8.6.0+2758+4f4474df |
| `pg_repack` | AlmaLinux:8 | All versions | 1.4.6-3.module_el8.6.0+2760+1746ec94 |
| `pgaudit` | AlmaLinux:8 | All versions | 1.4.0-5.module_el8.6.0+2758+4f4474df |
| `postgres-decoderbufs` | AlmaLinux:8 | All versions | 0.10.0-2.module_el8.6.0+2758+4f4474df |
| `postgres-decoderbufs` | AlmaLinux:8 | All versions | 0.10.0-2.module_el8.6.0+2760+1746ec94 |
| `postgresql` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-contrib` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-contrib` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-docs` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-docs` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-plperl` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-plperl` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-plpython3` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-plpython3` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-pltcl` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-pltcl` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-server` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-server` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-server-devel` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-server-devel` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-static` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-static` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-test` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-test` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-test-rpm-macros` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-test-rpm-macros` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-upgrade` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-upgrade` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql-upgrade-devel` | AlmaLinux:8 | All versions | 10.21-2.module_el8.6.0+2901+a6abf8d9 |
| `postgresql-upgrade-devel` | AlmaLinux:8 | All versions | 12.11-2.module_el8.6.0+2905+eb237fb8 |
| `postgresql` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-contrib` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-docs` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-plperl` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |
| `postgresql-plpython` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-8.el7_9 |

Products: Postgresql Postgresql.

## How do I fix CVE-2022-1552?

Upgrade postgresql to a fixed version for your release line: 10.21.0, 11.16.0, 12.11.0 or 13.7.0.

## Is CVE-2022-1552 being exploited?

There is no known exploitation of CVE-2022-1552 in the wild and no public exploit code.

## Other vulnerabilities in Postgresql Postgresql

- [CVE-2013-1902](https://insights.sbomify.com/CVE-2013-1902/): Information disclosure in n/a (critical 10.0)
- [CVE-2013-1903](https://insights.sbomify.com/CVE-2013-1903/): Information disclosure in n/a (critical 10.0)
- [CVE-2007-3279](https://insights.sbomify.com/CVE-2007-3279/): Privilege escalation in n/a (critical 10.0)
- [CVE-2002-1399](https://insights.sbomify.com/CVE-2002-1399/): Integer overflow in n/a (critical 10.0)
- [CVE-2016-3065](https://insights.sbomify.com/CVE-2016-3065/): Information disclosure in n/a (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-1552 and fix it if it is affected.

What it is: CVE-2022-1552 is a high-severity vulnerability in Postgresql Postgresql, published on 31 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-1552 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected from 10.0.0; fixed in 10.21.0, 11.16.0, 12.11.0, 13.7.0, 14.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-1552/ (Markdown: https://insights.sbomify.com/CVE-2022-1552/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-1552
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-1552
- OSV: https://osv.dev/vulnerability/CVE-2022-1552

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-1552/
Summaries are generated and may contain mistakes; the official description above is the record.
