CVE-2022-23365
📋 TL;DR
CVE-2022-23365 is a critical SQL injection vulnerability in HMS v1.0's doctorlogin.php that allows attackers to execute arbitrary SQL commands. This affects all systems running the vulnerable HMS version, potentially compromising patient data and system integrity.
💻 Affected Systems
- HMS (Hospital Management System)
📦 What is this software?
Hms by Hms Project
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, authentication bypass, remote code execution, and full system takeover.
Likely Case
Unauthorized access to patient records, modification of medical data, and potential privilege escalation within the HMS system.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only error messages or minor data exposure.
🎯 Exploit Status
SQL injection via doctorlogin.php parameter manipulation requires no authentication. Public discussion includes exploitation details.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
No official patch exists. Replace vulnerable code with parameterized queries or prepared statements in doctorlogin.php.
🔧 Temporary Workarounds
Web Application Firewall (WAF)
allDeploy a WAF with SQL injection protection rules to block exploitation attempts.
Input Validation
allImplement strict input validation and sanitization for all parameters in doctorlogin.php.
🧯 If You Can't Patch
- Isolate the HMS system from internet access and restrict to internal network only.
- Implement network segmentation and strict access controls to limit who can reach the vulnerable endpoint.
🔍 How to Verify
Check if Vulnerable:
Check if HMS version is 1.0 and examine doctorlogin.php for unsanitized SQL queries. Test with SQL injection payloads like ' OR '1'='1.
Check Version:
Check version in HMS configuration files or about page. For PHP systems: grep -r "version" /path/to/hms/ or check config files.
Verify Fix Applied:
Verify that parameterized queries or prepared statements are used in doctorlogin.php and test with SQL injection payloads.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts with SQL syntax
- Error messages containing SQL syntax in web server logs
Network Indicators:
- HTTP POST requests to doctorlogin.php with SQL keywords in parameters
- Unusual database connection patterns from web server
SIEM Query:
source="web_logs" AND uri="*doctorlogin.php*" AND (param="*' OR*" OR param="*UNION*" OR param="*SELECT*" OR param="*--*" OR param="*;*" OR param="*/*")