CVE-2024-22406
📋 TL;DR
This CVE describes a SQL injection vulnerability in Shopware's API search functionality. Attackers can exploit the 'name' field in aggregations parameters to execute arbitrary SQL queries, potentially leading to data theft or system compromise. All Shopware instances with vulnerable versions are affected.
💻 Affected Systems
- Shopware
📦 What is this software?
Shopware by Shopware
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including sensitive customer data, admin credentials, and potential remote code execution leading to full system takeover.
Likely Case
Data exfiltration of customer information, order history, and potentially administrative credentials.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only affecting non-sensitive data.
🎯 Exploit Status
Exploitation requires API access but SQL injection via time-based queries is well-documented and relatively simple to execute.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Shopware 6.5.7.4
Vendor Advisory: https://github.com/shopware/shopware/security/advisories/GHSA-qmp9-2xwj-m6m9
Restart Required: Yes
Instructions:
1. Update to Shopware 6.5.7.4 or later. 2. For older versions (6.1-6.4), install the security plugin provided by Shopware. 3. Restart the application server.
🔧 Temporary Workarounds
Input Validation Filter
allImplement strict input validation for the 'name' field in aggregations API calls to reject SQL injection patterns
API Access Restriction
allTemporarily restrict or disable API access to the vulnerable search functionality
🧯 If You Can't Patch
- Implement WAF rules to block SQL injection patterns in API requests
- Restrict database user permissions to minimize potential damage from successful exploitation
🔍 How to Verify
Check if Vulnerable:
Check Shopware version via admin panel or by examining the application files. Versions below 6.5.7.4 are vulnerable unless patched with security plugin.
Check Version:
Check Shopware version in admin panel or via composer show shopware/platform
Verify Fix Applied:
Verify installation of Shopware 6.5.7.4 or later, or confirm security plugin is installed for older versions.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed API requests with SQL-like patterns
- Long-running API requests suggesting time-based SQL injection
Network Indicators:
- Unusual API traffic patterns to search endpoints
- Requests containing SQL keywords in 'name' parameter
SIEM Query:
source="shopware_logs" AND (message="*aggregations*" AND message="*name*" AND (message="*SELECT*" OR message="*UNION*" OR message="*SLEEP*"))