CVE-2024-42357
📋 TL;DR
This CVE describes a SQL injection vulnerability in Shopware's application API search functionality. Attackers can exploit the 'name' field in the 'aggregations' object to execute arbitrary SQL commands. All Shopware instances running vulnerable versions are affected.
💻 Affected Systems
- Shopware
📦 What is this software?
Shopware by Shopware
Shopware by Shopware
⚠️ Risk & Real-World Impact
Worst Case
Full database compromise allowing data theft, modification, or deletion, potentially leading to complete system takeover if database privileges permit.
Likely Case
Unauthorized data access, extraction of sensitive information like customer data, orders, or administrative credentials.
If Mitigated
Limited impact due to input validation, parameterized queries, or database user restrictions.
🎯 Exploit Status
Exploitation requires API access; SQL injection via the 'name' parameter in aggregations object is straightforward for attackers with API credentials.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 6.6.5.1 or 6.5.8.13
Vendor Advisory: https://github.com/shopware/shopware/security/advisories/GHSA-p6w9-r443-r752
Restart Required: Yes
Instructions:
1. Update Shopware to version 6.6.5.1 or 6.5.8.13. 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 server-side validation to reject SQL keywords and special characters in the 'name' parameter of API requests.
API Access Restriction
allTemporarily restrict or disable API access to the vulnerable search endpoint until patching is complete.
🧯 If You Can't Patch
- Implement web application firewall (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 composer.lock file for version numbers below 6.6.5.1 or 6.5.8.13.
Check Version:
php bin/console --version
Verify Fix Applied:
Confirm version is 6.6.5.1 or higher, or 6.5.8.13 or higher; test API search with SQL injection attempts to ensure they are blocked.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- API requests containing SQL keywords in 'aggregations.name' parameter
- Error logs showing SQL syntax errors from API endpoints
Network Indicators:
- HTTP POST requests to /api/search endpoints with suspicious 'name' parameters
- Unusual traffic patterns to Shopware API
SIEM Query:
source="shopware_logs" AND ("aggregations.name" AND (SELECT, UNION, OR, --, /*))
🔗 References
- https://github.com/shopware/core/commit/63c05615694790f5790a04ef889f42b764fa53c9
- https://github.com/shopware/core/commit/a784aa1cec0624e36e0ee4d41aeebaed40e0442f
- https://github.com/shopware/shopware/commit/57ea2f3c59483cf7c0f853e7a0d68c23ded1fe5b
- https://github.com/shopware/shopware/commit/8504ba7e56e53add6a1d5b9d45015e3d899cd0ac
- https://github.com/shopware/shopware/security/advisories/GHSA-p6w9-r443-r752