CVE-2022-31347
📋 TL;DR
Online Car Wash Booking System v1.0 contains a SQL injection vulnerability in the delete_vehicle function that allows attackers to execute arbitrary SQL commands. This affects all systems running this specific software version. Attackers can potentially access, modify, or delete database content.
💻 Affected Systems
- Online Car Wash Booking System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including data theft, data destruction, authentication bypass, and potential remote code execution via database functions.
Likely Case
Unauthorized data access and modification, potential user data exposure, and system disruption.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only error messages or minor data exposure.
🎯 Exploit Status
Public proof-of-concept available on GitHub. SQL injection is a well-known attack vector with many automated tools available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None known
Restart Required: No
Instructions:
No official patch available. Consider implementing parameterized queries or input validation as described in workarounds.
🔧 Temporary Workarounds
Implement Parameterized Queries
allModify Master.php to use prepared statements with parameter binding instead of concatenating user input into SQL queries.
Edit /ocwbs/classes/Master.php to replace vulnerable SQL construction with PDO or mysqli prepared statements
Input Validation and Sanitization
allAdd strict input validation for the delete_vehicle parameter to only accept expected values.
Add validation: if(!is_numeric($_GET['id'])) { die('Invalid input'); }
🧯 If You Can't Patch
- Implement web application firewall (WAF) with SQL injection rules
- Restrict network access to the application, isolate it from sensitive systems
🔍 How to Verify
Check if Vulnerable:
Test the endpoint with SQL injection payloads: /ocwbs/classes/Master.php?f=delete_vehicle&id=1' OR '1'='1
Check Version:
Check application version in admin panel or configuration files
Verify Fix Applied:
Test with same payloads and verify they are rejected or properly handled without SQL execution.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in logs
- Multiple failed delete_vehicle requests with SQL syntax
Network Indicators:
- HTTP requests to Master.php with SQL keywords in parameters
- Unusual database query patterns
SIEM Query:
web.url:*Master.php* AND (web.param:*OR* OR web.param:*UNION* OR web.param:*SELECT*)