CVE-2024-8565

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in SourceCodesters Clinics Patient Management System 2.0 allows attackers to execute arbitrary SQL commands via the /print_diseases.php endpoint. Remote attackers can potentially access, modify, or delete sensitive patient data. All systems running the vulnerable version are affected.

💻 Affected Systems

Products:
  • SourceCodesters Clinics Patient Management System
Versions: 2.0
Operating Systems: Any OS running PHP/MySQL
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the /print_diseases.php endpoint with disease/from/to parameters

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to patient data theft, system takeover, or data destruction

🟠

Likely Case

Unauthorized access to sensitive patient records and medical information

🟢

If Mitigated

Limited impact with proper input validation and database permissions

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Public exploit code available on GitHub, requires minimal technical skill

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None found

Restart Required: No

Instructions:

No official patch available. Consider migrating to alternative software or implementing workarounds.

🔧 Temporary Workarounds

Input Validation Filter

all

Add parameter validation to /print_diseases.php to sanitize disease/from/to inputs

Modify print_diseases.php to use prepared statements with parameterized queries

WAF Rule

all

Implement web application firewall rules to block SQL injection patterns

Add WAF rule: deny requests containing SQL keywords in disease/from/to parameters

🧯 If You Can't Patch

  • Block external access to /print_diseases.php endpoint at network perimeter
  • Implement strict database user permissions with read-only access where possible

🔍 How to Verify

Check if Vulnerable:

Test /print_diseases.php with SQL injection payloads in disease, from, or to parameters

Check Version:

Check system documentation or admin panel for version information

Verify Fix Applied:

Verify parameterized queries are implemented and SQL injection attempts are rejected

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed parameter validation attempts

Network Indicators:

  • HTTP requests to /print_diseases.php with SQL keywords in parameters

SIEM Query:

source="web_logs" AND uri="/print_diseases.php" AND (param="disease" OR param="from" OR param="to") AND (content="UNION" OR content="SELECT" OR content="INSERT" OR content="DELETE")

🔗 References

📤 Share & Export