CVE-2022-32345

7.2 HIGH

📋 TL;DR

This SQL injection vulnerability in Hospital's Patient Records Management System v1.0 allows attackers to manipulate database queries through the 'id' parameter in the manage_room.php admin page. Attackers could potentially access, modify, or delete sensitive patient records. This affects all organizations using the vulnerable version of this healthcare software.

💻 Affected Systems

Products:
  • Hospital's Patient Records Management System
Versions: v1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation and requires no special configuration to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of patient database including theft of medical records, modification of treatment data, deletion of critical patient information, and potential ransomware deployment across the healthcare system.

🟠

Likely Case

Unauthorized access to patient records, exposure of sensitive health information (PHI), 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: ✅ No
Complexity: LOW

Exploitation requires admin access to the /hprms/admin/ endpoint, but SQL injection techniques are well-documented and easy to implement.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Unknown

Restart Required: No

Instructions:

No official patch available. Implement workarounds and consider migrating to a supported, secure alternative system.

🔧 Temporary Workarounds

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection protection rules to block malicious requests to the vulnerable endpoint.

Input Validation Filter

all

Add server-side input validation to sanitize the 'id' parameter before processing.

Example PHP: $id = filter_var($_GET['id'], FILTER_VALIDATE_INT); if($id === false) { die('Invalid input'); }

🧯 If You Can't Patch

  • Isolate the system on a separate network segment with strict access controls
  • Implement database-level protections: use parameterized queries, restrict database user permissions, enable audit logging

🔍 How to Verify

Check if Vulnerable:

Test the endpoint with SQL injection payloads: /hprms/admin/rooms/manage_room.php?id=1' OR '1'='1

Check Version:

Check system documentation or about page for version information

Verify Fix Applied:

Test with the same payloads after implementing fixes - should return error or no data instead of executing SQL

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple failed login attempts followed by SQL payloads
  • Requests with SQL keywords in URL parameters

Network Indicators:

  • HTTP requests containing SQL syntax in the 'id' parameter
  • Unusual database query patterns from application server

SIEM Query:

source="web_logs" AND (url="*manage_room.php*" AND (param="*id=*'*" OR param="*id=* OR *" OR param="*id=* UNION *"))

🔗 References

📤 Share & Export