CVE-2024-53947
📋 TL;DR
This SQL injection vulnerability in Apache Superset allows attackers to bypass SQL authorization by exploiting unvalidated PostgreSQL functions. Attackers can execute arbitrary SQL commands, potentially accessing or modifying database content. This affects all Apache Superset installations before version 4.1.0.
💻 Affected Systems
- Apache Superset
📦 What is this software?
Superset by Apache
⚠️ Risk & Real-World Impact
Worst Case
Full database compromise including data exfiltration, modification, or deletion; potential privilege escalation to execute system commands via database functions.
Likely Case
Unauthorized data access, data manipulation, and potential extraction of sensitive information from connected databases.
If Mitigated
Limited impact with proper network segmentation and database user privilege restrictions, though SQL injection would still be possible.
🎯 Exploit Status
Exploitation requires authenticated access to Superset, but SQL injection techniques are well-documented and easy to weaponize.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.1.0
Vendor Advisory: https://lists.apache.org/thread/hj3gfsjh67vqw12nlrshlsym4bkopjmn
Restart Required: Yes
Instructions:
1. Backup your Superset instance and database. 2. Upgrade to Apache Superset 4.1.0 using pip: 'pip install apache-superset==4.1.0'. 3. Run database migrations: 'superset db upgrade'. 4. Restart all Superset services.
🔧 Temporary Workarounds
Add functions to DISALLOWED_SQL_FUNCTIONS
allAdd the vulnerable PostgreSQL functions to the configuration blacklist
Add to superset_config.py: DISALLOWED_SQL_FUNCTIONS = ['query_to_xml_and_xmlschema', 'table_to_xml', 'table_to_xml_and_xmlschema']
🧯 If You Can't Patch
- Restrict database user permissions to read-only access for Superset connections
- Implement network segmentation to isolate Superset from sensitive databases
🔍 How to Verify
Check if Vulnerable:
Check Superset version: if version is less than 4.1.0 and using PostgreSQL backend, system is vulnerable.
Check Version:
pip show apache-superset | grep Version
Verify Fix Applied:
Verify version is 4.1.0 or higher and test that the vulnerable functions are blocked in SQL Lab.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries containing query_to_xml_and_xmlschema, table_to_xml, or table_to_xml_and_xmlschema functions
- Multiple failed authorization attempts followed by successful complex queries
Network Indicators:
- Unusual database traffic patterns from Superset application servers
- Large data transfers from database to Superset
SIEM Query:
source="superset" AND ("query_to_xml" OR "table_to_xml")