CVE-2024-7667
📋 TL;DR
This critical SQL injection vulnerability in SourceCodester Car Driving School Management System 1.0 allows remote attackers to execute arbitrary SQL commands via the delete_users function. Attackers can potentially access, modify, or delete database content. All deployments of version 1.0 are affected.
💻 Affected Systems
- SourceCodester Car Driving School Management System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including data theft, data destruction, privilege escalation to admin, and potential remote code execution via database functions.
Likely Case
Unauthorized data access and manipulation, user account compromise, and potential system takeover through admin credential extraction.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only allowing data viewing without modification.
🎯 Exploit Status
Exploit requires authentication but SQL injection is straightforward once authenticated. Public proof-of-concept available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None available
Restart Required: No
Instructions:
1. Check vendor website for updates
2. Apply any available patches
3. Verify fix by testing the vulnerable endpoint
🔧 Temporary Workarounds
Input Validation Filter
allAdd parameterized queries or input validation to User.php delete_users function
Modify User.php to use prepared statements: $stmt = $conn->prepare('DELETE FROM users WHERE id = ?'); $stmt->bind_param('i', $id);
WAF Rule
allImplement web application firewall rules to block SQL injection patterns
Add WAF rule: Detect and block SQL keywords in 'id' parameter of delete_users requests
🧯 If You Can't Patch
- Isolate the system behind a firewall with strict access controls
- Implement database user with minimal permissions (read-only where possible)
🔍 How to Verify
Check if Vulnerable:
Test the delete_users endpoint with SQL injection payloads like: id=1' OR '1'='1
Check Version:
Check system version in admin panel or readme files
Verify Fix Applied:
Test with same payloads and verify no SQL errors or unexpected behavior occurs
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL errors in application logs
- Multiple delete_users requests with suspicious parameters
- Database queries with unexpected UNION or SELECT statements
Network Indicators:
- HTTP requests to User.php with SQL keywords in parameters
- Unusual database connection patterns from web server
SIEM Query:
source="web_logs" AND uri="*User.php*" AND (param="*id=*'*" OR param="*id=* OR *" OR param="*id=* UNION *")