CVE-2024-10407
📋 TL;DR
This critical SQL injection vulnerability in SourceCodester Petrol Pump Management Software 1.0 allows remote attackers to manipulate database queries through the 'id' parameter in /admin/edit_customer.php. Attackers can potentially read, modify, or delete sensitive data from the database. All users running the vulnerable software version are affected.
💻 Affected Systems
- SourceCodester Petrol Pump Management Software
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including theft of sensitive customer/payment data, administrative credential theft, and potential system takeover through privilege escalation.
Likely Case
Data exfiltration of customer records, financial information, and business operations data leading to privacy violations and operational disruption.
If Mitigated
Limited impact if proper input validation and WAF rules block malicious SQL payloads, though underlying vulnerability remains.
🎯 Exploit Status
Exploit requires access to admin interface. SQL injection is well-understood with many automated tools available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: https://www.sourcecodester.com/
Restart Required: No
Instructions:
1. Check vendor website for security updates. 2. If patch available, download and apply. 3. Test functionality after patching.
🔧 Temporary Workarounds
Input Validation and Sanitization
allAdd parameterized queries or proper input sanitization to /admin/edit_customer.php
Modify PHP code to use prepared statements: $stmt = $conn->prepare('SELECT * FROM customers WHERE id = ?'); $stmt->bind_param('i', $id);
Web Application Firewall Rules
allDeploy WAF rules to block SQL injection patterns targeting edit_customer.php
Add WAF rule: SecRule REQUEST_URI "@contains /admin/edit_customer.php" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt detected'"
🧯 If You Can't Patch
- Restrict network access to admin interface using firewall rules or VPN
- Implement database monitoring and alerting for unusual SQL queries
🔍 How to Verify
Check if Vulnerable:
Test /admin/edit_customer.php?id=1' OR '1'='1 and observe if SQL error or unexpected behavior occurs
Check Version:
Check software version in admin panel or readme files
Verify Fix Applied:
Test same payload after remediation - should return proper error handling without SQL errors
📡 Detection & Monitoring
Log Indicators:
- SQL syntax errors in web server logs
- Unusual database queries from web application user
- Multiple failed parameter validation attempts
Network Indicators:
- HTTP requests to /admin/edit_customer.php with SQL keywords in parameters
- Unusual traffic patterns to admin interface
SIEM Query:
source="web_server.log" AND uri="/admin/edit_customer.php" AND (param="id" AND value MATCHES "'.*OR.*|UNION|SELECT.*")