CVE-2024-7196
📋 TL;DR
This critical SQL injection vulnerability in SourceCodester Complaints Report Management System 1.0 allows attackers to execute arbitrary SQL commands via the username parameter in the /admin/ajax.php?action=login endpoint. Attackers can potentially bypass authentication, access sensitive data, or compromise the database. All deployments of version 1.0 are affected.
💻 Affected Systems
- SourceCodester Complaints Report Management System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, authentication bypass, privilege escalation, and potential remote code execution on the underlying server.
Likely Case
Authentication bypass allowing unauthorized admin access, followed by data exfiltration and potential system takeover.
If Mitigated
Limited impact with proper input validation and WAF rules blocking SQL injection patterns.
🎯 Exploit Status
Public exploit code is available. The vulnerability requires no authentication and is simple to exploit.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None available
Restart Required: No
Instructions:
No official patch available. Consider upgrading to a newer version if available, or implement workarounds.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement proper input validation and parameterized queries for the username parameter in /admin/ajax.php
WAF Rule Implementation
allDeploy web application firewall rules to block SQL injection patterns targeting the vulnerable endpoint
🧯 If You Can't Patch
- Restrict access to /admin/ajax.php endpoint using network ACLs or authentication
- Implement database user with minimal privileges for the application
🔍 How to Verify
Check if Vulnerable:
Test the /admin/ajax.php?action=login endpoint with SQL injection payloads in the username parameter
Check Version:
Check application version in admin panel or configuration files
Verify Fix Applied:
Verify that SQL injection attempts no longer succeed and proper input validation is implemented
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts with SQL payloads
- Access to /admin/ajax.php with suspicious parameters
Network Indicators:
- HTTP requests to /admin/ajax.php containing SQL keywords in parameters
- Unusual database connection patterns
SIEM Query:
source="web_logs" AND uri="/admin/ajax.php" AND (param="username" AND value CONTAINS "' OR" OR value CONTAINS "UNION" OR value CONTAINS "SELECT")
🔗 References
- https://gist.github.com/topsky979/7c314add775caa87b4db700e0bef7f35
- https://vuldb.com/?ctiid.272617
- https://vuldb.com/?id.272617
- https://vuldb.com/?submit.380408
- https://gist.github.com/topsky979/7c314add775caa87b4db700e0bef7f35
- https://vuldb.com/?ctiid.272617
- https://vuldb.com/?id.272617
- https://vuldb.com/?submit.380408