CVE-2022-46497

8.1 HIGH

📋 TL;DR

Hospital Management System 1.0 contains a SQL injection vulnerability in the pat_number parameter at his_doc_view_single_patien.php. This allows attackers to execute arbitrary SQL commands on the database, potentially compromising patient data and system integrity. Healthcare organizations using this specific software version are affected.

💻 Affected Systems

Products:
  • Hospital Management System
Versions: 1.0
Operating Systems: Any OS running PHP and MySQL/MariaDB
Default Config Vulnerable: ⚠️ Yes
Notes: Requires PHP environment with database backend. The vulnerability is in the web application code itself.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to patient data theft, system takeover, ransomware deployment, and potential patient safety risks if medical records are altered.

🟠

Likely Case

Unauthorized access to patient records, extraction of sensitive medical information, and potential data exfiltration for identity theft or blackmail.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error messages or limited data exposure.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection is well-understood with many automated tools available. The parameter is directly exposed in the URL/request.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Not available

Restart Required: No

Instructions:

1. Contact the software vendor for an official patch. 2. If no patch available, implement workarounds immediately. 3. Consider migrating to supported software.

🔧 Temporary Workarounds

Input Validation and Parameterized Queries

all

Modify the PHP code to use prepared statements with parameterized queries instead of direct string concatenation.

Replace vulnerable code with: $stmt = $conn->prepare('SELECT * FROM patients WHERE pat_number = ?'); $stmt->bind_param('s', $pat_number); $stmt->execute();

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection rules to block malicious requests.

🧯 If You Can't Patch

  • Isolate the system from internet access and restrict to internal network only
  • Implement strict network segmentation and monitor all database access attempts

🔍 How to Verify

Check if Vulnerable:

Test the his_doc_view_single_patien.php endpoint with SQL injection payloads like: pat_number=1' OR '1'='1

Check Version:

Check software documentation or about page for version information

Verify Fix Applied:

Test with the same payloads and verify they are rejected or properly handled without database errors

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL syntax in web server logs
  • Multiple failed login attempts from single IP
  • Database error messages containing SQL fragments

Network Indicators:

  • Unusual database query patterns
  • Large data transfers from database server
  • SQL keywords in HTTP requests to vulnerable endpoint

SIEM Query:

source="web_server" AND (url="*his_doc_view_single_patien.php*" AND (query="*' OR*" OR query="*UNION*" OR query="*SELECT*"))

🔗 References

📤 Share & Export