CVE-2022-32347

7.2 HIGH

📋 TL;DR

This SQL injection vulnerability in Hospital's Patient Records Management System v1.0 allows attackers to execute arbitrary SQL commands via the delete_room function. Attackers can potentially access, modify, or delete sensitive patient records. All deployments of this specific software version are affected.

💻 Affected Systems

Products:
  • Hospital's Patient Records Management System
Versions: v1.0
Operating Systems: Any
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of v1.0 regardless of configuration. The vulnerability is in the Master.php file handling room deletion.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including patient medical records, personal information, and system credentials leading to data breach, medical identity theft, and system takeover.

🟠

Likely Case

Unauthorized access to patient records, data exfiltration, and potential manipulation of medical data affecting patient care.

🟢

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

Public proof-of-concept exists in GitHub repository. SQL injection is straightforward with common tools like sqlmap.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None found

Restart Required: No

Instructions:

1. Check vendor website for updates
2. If patch available, download and apply
3. Test functionality after update
4. No official patch identified at this time

🔧 Temporary Workarounds

WAF Rule Implementation

all

Deploy web application firewall rules to block SQL injection patterns

# Example ModSecurity rule: SecRule ARGS "@detectSQLi" "id:1001,phase:2,deny,status:403"

Input Validation Filter

all

Add input validation to sanitize parameters before processing

# PHP example: $room_id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);

🧯 If You Can't Patch

  • Isolate the system behind a firewall with strict access controls
  • Implement database-level protections: use prepared statements, parameterized queries, and least privilege database accounts

🔍 How to Verify

Check if Vulnerable:

Test the endpoint /hprms/classes/Master.php?f=delete_room with SQL injection payloads like ' OR '1'='1

Check Version:

Check system documentation or configuration files for version information

Verify Fix Applied:

Test with same payloads after remediation - should return error or no data manipulation

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • Multiple failed delete_room attempts
  • SQL syntax errors in logs

Network Indicators:

  • Unusual traffic patterns to Master.php endpoint
  • SQL injection patterns in HTTP requests

SIEM Query:

source="web_logs" AND uri="/hprms/classes/Master.php" AND (query CONTAINS "delete_room" OR query CONTAINS SQL keywords)

🔗 References

📤 Share & Export