CVE-2022-2298

7.3 HIGH

📋 TL;DR

This is a critical SQL injection vulnerability in SourceCodester Clinics Patient Management System 2.0 that allows attackers to bypass authentication on the login page. By injecting SQL commands into the user_name parameter, attackers can gain unauthorized access to the system. All installations of version 2.0 are affected.

💻 Affected Systems

Products:
  • SourceCodester Clinics Patient Management System
Versions: 2.0
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation with no special configuration required.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing data theft, modification, or deletion of patient records, and potential lateral movement to other systems.

🟠

Likely Case

Unauthorized access to patient management system leading to data breach of sensitive medical information.

🟢

If Mitigated

Limited impact with proper input validation and database permissions restricting damage to non-sensitive data.

🌐 Internet-Facing: HIGH - The vulnerability is in the login page which is typically internet-facing, allowing remote exploitation.
🏢 Internal Only: MEDIUM - Internal systems could still be compromised through phishing or insider threats.

🎯 Exploit Status

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

Simple SQL injection payloads can bypass authentication without requiring any prior access.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available or implementing workarounds.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to sanitize user_name parameter before SQL processing

Modify /pms/index.php to use prepared statements or parameterized queries

Web Application Firewall Rule

all

Block SQL injection patterns in the user_name parameter

Add WAF rule to detect and block patterns like 'or '1'='1' in login requests

🧯 If You Can't Patch

  • Implement network segmentation to isolate the system from sensitive networks
  • Enable detailed logging and monitoring for SQL injection attempts on the login page

🔍 How to Verify

Check if Vulnerable:

Attempt to login with payload: admin' or '1'='1 in username field. If login succeeds without valid credentials, system is vulnerable.

Check Version:

Check system documentation or about page for version information, or examine PHP files for version markers

Verify Fix Applied:

Attempt the same SQL injection payload. System should reject the login attempt or return an error without granting access.

📡 Detection & Monitoring

Log Indicators:

  • Failed login attempts with SQL keywords in username field
  • Successful logins from unusual IP addresses after SQL injection patterns

Network Indicators:

  • HTTP POST requests to /pms/index.php containing SQL injection patterns in parameters

SIEM Query:

source="web_logs" AND uri="/pms/index.php" AND (user_name CONTAINS "'or'" OR user_name CONTAINS "'1'='1'")

🔗 References

📤 Share & Export