PostgreSQL Row Security Policy Vulnerability in Alpine Packages - CVE-2023-2455
Summary
ALPINE-CVE-2023-2455: Row security policies disregard user ID changes after inlining; PostgreSQL could permit incorrect policies to be applied in certain cases where role-specific policies are used and a given query is planned under one role... Affects postgresql versions < 13.11-r0. Fixed in 13.11-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. The vulnerability in question affects the PostgreSQL package in various Alpine Linux versions, specifically related to row security policies that may not function as intended under certain role changes.
Vulnerability Detail
The vulnerability arises from the handling of row security policies in PostgreSQL, where user ID changes after inlining can lead to incorrect policies being applied. This issue can occur when role-specific policies are used, and a query is planned under one role but executed under another. This scenario is particularly relevant in security definer functions or when a common user and query are reused across multiple SET ROLEs. As a result, a user may be able to perform unauthorized reads and modifications, undermining the security model of the database. The vulnerability affects databases that have implemented CREATE POLICY for defining row security policies.
How To Fix
Minimum fixed version
13.11-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, consider reviewing and adjusting your row security policies to ensure they are not reliant on user ID changes after inlining. Additionally, avoid using security definer functions if possible until the package is updated.
Conclusion
In summary, CVE-2023-2455 is a significant vulnerability affecting PostgreSQL row security policies in various Alpine Linux versions. It is crucial to update to the patched versions to mitigate the risks associated with unauthorized data access. Regular monitoring and updates are essential for maintaining database security.
See every vulnerability recorded for postgresql →
FAQ
CVE-2023-2455 is a vulnerability in PostgreSQL that affects row security policies, allowing incorrect policies to be applied under certain conditions.
The vulnerability affects PostgreSQL packages in Alpine Linux versions 3.13, 3.14, 3.15, 3.16, 3.17, 3.18, 3.19, and 3.20.
The vulnerability may allow unauthorized users to perform reads and modifications that should be restricted, compromising database security.
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 of this vulnerability is 5.4, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for postgresql.