SQL Injection vulnerability in PostgreSQL
Summary
CVE-2023-39417: IN THE EXTENSION SCRIPT, a SQL Injection vulnerability was found in PostgreSQL if it uses @extowner@, @extschema@, or @extschema:...@ inside a quoting construct (dollar quoting, '', or ""). Affects postgresql versions < 13.12-r0. Fixed in 13.12-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 an open-source relational database management system known for its robustness, extensibility, and adherence to SQL standards. It is widely used in various applications and provides advanced features for data storage and retrieval. However, a SQL Injection vulnerability has been discovered in PostgreSQL that can be exploited by an attacker with certain privileges.
Vulnerability Detail
The SQL Injection vulnerability in PostgreSQL arises when the extension script uses @extowner@, @extschema@, or @extschema:...@ inside a quoting construct (dollar quoting, '', or ""). If an administrator has installed files of a vulnerable, trusted, non-bundled extension, an attacker with database-level CREATE privilege can execute arbitrary code as the bootstrap superuser. This can lead to unauthorized access, data manipulation, or even complete compromise of the database.
How To Fix
Minimum fixed version
13.12-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, administrators can review and remove any vulnerable, trusted, non-bundled extensions from the PostgreSQL installation. Additionally, they should ensure that only trusted extensions are installed and regularly monitor for any suspicious activities or unauthorized access attempts.
Conclusion
The SQL Injection vulnerability in PostgreSQL can have severe consequences if exploited. It is crucial to update PostgreSQL to the latest version and review the installed extensions to ensure they are trusted and not vulnerable. Regular monitoring and security measures should be implemented to detect and prevent any unauthorized access or data manipulation. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for postgresql →
FAQ
PostgreSQL is an open-source relational database management system known for its robustness, extensibility, and adherence to SQL standards.
SQL Injection is a type of vulnerability that allows an attacker to manipulate SQL queries by injecting malicious input. In the case of PostgreSQL, it can lead to unauthorized access, data manipulation, or compromise of the database.
Any system or application that uses PostgreSQL and has installed vulnerable, trusted, non-bundled extensions can be affected by this vulnerability.
An attacker with database-level CREATE privilege is required to exploit this vulnerability.
Updating PostgreSQL to the latest version that includes the fix is the most effective way to mitigate the risk of exploitation. Regularly monitoring for suspicious activities and unauthorized access attempts is also recommended.
Related vulnerabilities
Recent vulnerabilities recorded for postgresql.