CVE-2024-49042

7.2 HIGH

📋 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

Products:
  • Azure Database for PostgreSQL Flexible Server
Versions: All versions before the security update
Operating Systems: Azure managed service - no specific OS
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated database user with CREATE privilege on the database

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

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

all

Remove CREATE privilege from non-administrative database users to prevent extension installation

REVOKE CREATE ON DATABASE database_name FROM username;

Disable Unnecessary Extensions

all

Remove 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"

🔗 References

📤 Share & Export