CVE-2023-5794
📋 TL;DR
This critical SQL injection vulnerability in PHPGurukul Online Railway Catering System 1.0 allows attackers to manipulate database queries through the username parameter in the login page. Attackers can potentially steal sensitive data, modify database contents, or gain unauthorized access. Any organization using this specific software version is affected.
💻 Affected Systems
- PHPGurukul Online Railway Catering System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, privilege escalation, authentication bypass, and potential remote code execution if database functions allow it.
Likely Case
Unauthorized access to sensitive user data, credential theft, and potential system takeover through SQL injection payloads.
If Mitigated
Limited impact with proper input validation, parameterized queries, and web application firewall rules blocking SQL injection patterns.
🎯 Exploit Status
Public GitHub repository shows exploitation details. SQL injection via username parameter requires no authentication.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None found
Restart Required: No
Instructions:
1. Review vendor website for updates
2. If no patch available, implement parameterized queries
3. Sanitize all user inputs
4. Apply input validation on username field
🔧 Temporary Workarounds
Input Validation and Sanitization
allAdd server-side validation to reject SQL injection patterns in username field
// PHP example: Use prepared statements with PDO or mysqli
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = :username');
$stmt->execute(['username' => $username]);
Web Application Firewall Rules
allConfigure WAF to block SQL injection patterns targeting login endpoints
# Example ModSecurity rule
SecRule ARGS:username "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQL Injection Attempt'
🧯 If You Can't Patch
- Implement network segmentation to isolate the vulnerable system
- Deploy a web application firewall with SQL injection detection rules
🔍 How to Verify
Check if Vulnerable:
Test login page with SQL injection payloads like ' OR '1'='1 in username field and observe database errors or unexpected behavior
Check Version:
Check software documentation or about page for version information
Verify Fix Applied:
Attempt SQL injection payloads and verify they are rejected or properly sanitized without database errors
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL syntax in username fields
- Database error messages in application logs
- Multiple failed login attempts with SQL patterns
Network Indicators:
- HTTP POST requests to login endpoint containing SQL keywords in parameters
- Unusual database query patterns from web server
SIEM Query:
source="web_logs" AND (uri_path="/index.php" OR uri_path="/login") AND (username="*OR*" OR username="*UNION*" OR username="*SELECT*" OR username="*--*")
🔗 References
- https://github.com/JacksonStonee/Online-Railway-Catering-System-1.0-has-a-SQL-injection-vulnerability-in-index.php/tree/main
- https://vuldb.com/?ctiid.243600
- https://vuldb.com/?id.243600
- https://github.com/JacksonStonee/Online-Railway-Catering-System-1.0-has-a-SQL-injection-vulnerability-in-index.php/tree/main
- https://vuldb.com/?ctiid.243600
- https://vuldb.com/?id.243600