CVE-2024-28558
📋 TL;DR
This SQL injection vulnerability in Petrol Pump Management Software v1.0 allows remote attackers to execute arbitrary SQL commands via the admin/app/web_crud.php endpoint. Attackers can potentially read, modify, or delete database content, escalate privileges, and execute arbitrary code. 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 system compromise including arbitrary code execution, privilege escalation to admin, database exfiltration, and potential lateral movement to other systems.
Likely Case
Database compromise leading to sensitive information disclosure (customer data, financial records), privilege escalation, and potential website defacement.
If Mitigated
Limited impact with proper input validation and WAF in place, potentially only error messages or partial data exposure.
🎯 Exploit Status
Public proof-of-concept available on GitHub, exploitation requires basic SQL injection knowledge.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: Not available
Restart Required: No
Instructions:
No official patch available. Consider replacing with alternative software or implementing custom fixes.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement parameterized queries and input validation for all user inputs in web_crud.php
Modify PHP code to use prepared statements: $stmt = $conn->prepare('SELECT * FROM table WHERE id = ?'); $stmt->bind_param('i', $id);
Web Application Firewall (WAF)
linuxDeploy WAF with SQL injection rules to block malicious payloads
Install and configure ModSecurity with OWASP Core Rule Set
🧯 If You Can't Patch
- Isolate the system behind a reverse proxy with strict input filtering
- Implement network segmentation to limit database access from web server
🔍 How to Verify
Check if Vulnerable:
Test the admin/app/web_crud.php endpoint with SQL injection payloads like ' OR '1'='1
Check Version:
Check software version in admin panel or readme files
Verify Fix Applied:
Verify that SQL injection payloads no longer execute and return error messages
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts
- Suspicious POST requests to web_crud.php
Network Indicators:
- SQL keywords in HTTP POST parameters
- Unusual database connection patterns
SIEM Query:
source=web_logs AND (uri="*web_crud.php*" AND (param="*' OR*" OR param="*UNION*" OR param="*SELECT*"))