PostgreSQL Vulnerability: Arbitrary Code Execution Risk in Extensions
Summary
ALPINE-CVE-2022-2625: A vulnerability was found in PostgreSQL. Affects postgresql versions < 13.8-r0. Fixed in 13.8-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, a vulnerability has been identified that allows attackers with specific permissions to execute arbitrary code through malicious extensions, posing a significant security risk.
Vulnerability Detail
A vulnerability was found in PostgreSQL that allows an attacker to run arbitrary code as the victim role, which may be a superuser. This attack requires permission to create non-temporary objects in at least one schema, the ability to lure or wait for an administrator to create or update an affected extension in that schema, and the ability to lure or wait for a victim to use the object targeted in CREATE OR REPLACE or CREATE IF NOT EXISTS. The CVSS score for this vulnerability is 8.0, indicating a high severity level.
How To Fix
Minimum fixed version
13.8-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 where extensions are used. This can help mitigate the risk until the package is updated.
Conclusion
The identified vulnerability in PostgreSQL poses a significant risk, allowing arbitrary code execution under certain conditions. It is crucial for users to update their installations to the patched versions to mitigate this risk. Additionally, implementing temporary workarounds can help secure systems until updates are applied.
See every vulnerability recorded for postgresql →
FAQ
The vulnerability allows an attacker to execute arbitrary code as the victim role, potentially compromising the database.
Any PostgreSQL installation that allows users to create non-temporary objects in schemas with vulnerable extensions is at risk.
You can use Vulert, which monitors open-source vulnerabilities in your software using just a manifest file. Check your application at Vulert Scanner.
Implement the suggested workaround by restricting permissions for users who can create non-temporary objects in vulnerable schemas.
The CVSS score of this vulnerability is 8.0, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for postgresql.