CVE-2024-49042
📋 TL;DR
This vulnerability allows authenticated users with CREATE privilege on Azure Database for PostgreSQL Flexible Server to execute arbitrary commands through specially crafted extension installation. It affects Azure Database for PostgreSQL Flexible Server instances with vulnerable extensions.
💻 Affected Systems
- Azure Database for PostgreSQL Flexible Server
📦 What is this software?
Azure Database For Postgresql Flexible Server by Microsoft
View all CVEs affecting Azure Database For Postgresql Flexible Server →
Azure Database For Postgresql Flexible Server by Microsoft
View all CVEs affecting Azure Database For Postgresql Flexible Server →
Azure Database For Postgresql Flexible Server by Microsoft
View all CVEs affecting Azure Database For Postgresql Flexible Server →
⚠️ Risk & Real-World Impact
Worst Case
Attackers gain full database administrator privileges, allowing data exfiltration, data destruction, or lateral movement to other Azure resources.
Likely Case
Privileged database users escalate to superuser privileges, enabling unauthorized data access and modification.
If Mitigated
Limited impact with proper access controls and network segmentation restricting database access to authorized applications only.
🎯 Exploit Status
Requires authenticated database access and knowledge of PostgreSQL extension system
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Latest Azure Database for PostgreSQL Flexible Server version
Vendor Advisory: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-49042
Restart Required: No
Instructions:
1. Navigate to Azure Portal 2. Select your PostgreSQL Flexible Server 3. Go to 'Compute + storage' settings 4. Apply the latest service update 5. No restart required - update applies automatically
🔧 Temporary Workarounds
Restrict CREATE Privilege
allRemove CREATE privilege from non-administrative database users to prevent extension installation
REVOKE CREATE ON DATABASE database_name FROM username;
Disable Unnecessary Extensions
allRemove or disable PostgreSQL extensions that are not required for your application
DROP EXTENSION extension_name;
🧯 If You Can't Patch
- Implement strict network access controls to limit database connections to trusted applications only
- Enable Azure Defender for SQL and configure alerting for suspicious database activities
🔍 How to Verify
Check if Vulnerable:
Check if your Azure Database for PostgreSQL Flexible Server has applied the latest service update in Azure Portal
Check Version:
SELECT version();
Verify Fix Applied:
Verify the service update status shows as completed in Azure Portal and check that no unauthorized extensions exist
📡 Detection & Monitoring
Log Indicators:
- Unusual CREATE EXTENSION commands
- Extension installations from non-standard users
- Failed extension installation attempts
Network Indicators:
- Database connections from unexpected sources attempting to create extensions
SIEM Query:
AzureDiagnostics | where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL" | where Category == "PostgreSQLLogs" | where Message has "CREATE EXTENSION"