PostgreSQL Privilege Escalation Vulnerability - CVE-2022-1552
Summary
ALPINE-CVE-2022-1552: A flaw was found in PostgreSQL. Affects postgresql versions < 13.7-r0. Fixed in 13.7-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PostgreSQL is a powerful, open-source relational database system that uses and extends the SQL language. It is known for its robustness, extensibility, and support for advanced data types. However, it is susceptible to vulnerabilities that can compromise its security. CVE-2022-1552 is a significant vulnerability that affects multiple versions of PostgreSQL, allowing attackers to execute arbitrary SQL functions with superuser privileges under certain conditions.
Vulnerability Detail
CVE-2022-1552 is a flaw in PostgreSQL that arises from incomplete safety measures when a privileged user manages another user's objects. Specifically, commands such as Autovacuum, REINDEX, CREATE INDEX, REFRESH MATERIALIZED VIEW, CLUSTER, and pg_amcheck fail to activate necessary protections in a timely manner. This oversight permits an attacker, who has permission to create non-temporary objects in at least one schema, to execute arbitrary SQL functions as a superuser, potentially leading to unauthorized access and manipulation of sensitive data.
How To Fix
Minimum fixed version
13.7-r0
This is the first release that contains the fix.
sudo apk add --upgrade postgresql
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, restrict permissions for users who can create non-temporary objects in schemas until the package is updated. This can be done by reviewing and adjusting user roles and privileges in PostgreSQL.
Conclusion
CVE-2022-1552 is a critical vulnerability in PostgreSQL that can lead to privilege escalation. It is crucial for users to update their PostgreSQL installations to the patched versions to safeguard against potential exploitation. Additionally, implementing temporary workarounds can help mitigate risks until updates are applied.
See every vulnerability recorded for postgresql →
FAQ
CVE-2022-1552 is a vulnerability in PostgreSQL that allows an attacker to execute arbitrary SQL functions with superuser privileges due to incomplete safety measures.
The vulnerability affects multiple versions of PostgreSQL, specifically those in Alpine v3.13, v3.14, v3.15, v3.16, v3.17, v3.18, v3.19, and v3.20.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score for CVE-2022-1552 is 8.8, indicating a high severity level.
If immediate updates are not possible, consider restricting user permissions to mitigate the risk until the patch can be applied.
References
Related vulnerabilities
Recent vulnerabilities recorded for postgresql.