PostgreSQL Logical Replication Vulnerability - CVE-2020-14349
Summary
ALPINE-CVE-2020-14349: It was found that PostgreSQL versions before 12.4, before 11.9 and before 10.14 did not properly sanitize the search_path during logical replication. Affects postgresql versions < 11.9-r0. Fixed in 11.9-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 object-relational database system that uses and extends the SQL language. It is known for its reliability, feature robustness, and performance. The vulnerability CVE-2020-14349 affects multiple versions of PostgreSQL, where improper sanitization of the search_path during logical replication can lead to unauthorized SQL command execution by authenticated attackers.
Vulnerability Detail
The vulnerability arises from the failure of PostgreSQL versions prior to 12.4, 11.9, and 10.14 to properly sanitize the search_path during logical replication. This flaw allows an authenticated attacker to exploit the system in a manner similar to CVE-2018-1058, potentially executing arbitrary SQL commands in the context of the user used for replication. The implications of this vulnerability are significant, as it can lead to unauthorized data manipulation and compromise the integrity of the database.
How To Fix
Minimum fixed version
11.9-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 restricting access to the replication user and ensuring that only trusted users have the ability to execute replication commands. This can help mitigate the risk until the package is updated.
Conclusion
CVE-2020-14349 represents a significant security risk for PostgreSQL users, allowing for potential unauthorized SQL command execution. It is crucial to update to the latest patched versions to safeguard against this vulnerability. Utilizing tools like Vulert can help in monitoring and managing such vulnerabilities effectively.
See every vulnerability recorded for postgresql →
FAQ
CVE-2020-14349 is a vulnerability in PostgreSQL that allows authenticated attackers to execute arbitrary SQL commands due to improper sanitization of the search_path during logical replication.
Versions of PostgreSQL prior to 12.4, 11.9, and 10.14 are affected by this vulnerability.
You can use Vulert to monitor and alert in real-time for open-source vulnerabilities. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.
The CVSS score for CVE-2020-14349 is 7.1, indicating a high severity level.
If immediate updates are not possible, restrict access to the replication user and monitor database activity closely to mitigate potential risks.
References
Related vulnerabilities
Recent vulnerabilities recorded for postgresql.