CVE-2024-5093

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in SourceCodester Best House Rental Management System 1.0 allows attackers to bypass authentication by manipulating username/password parameters in login.php. Remote attackers can execute arbitrary SQL commands, potentially gaining unauthorized access to the system. All deployments of version 1.0 are affected.

💻 Affected Systems

Products:
  • SourceCodester Best House Rental Management System
Versions: 1.0
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: All installations of version 1.0 are vulnerable. The vulnerability exists in the core authentication mechanism.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise including database takeover, data exfiltration, privilege escalation, and potential ransomware deployment.

🟠

Likely Case

Authentication bypass leading to unauthorized administrative access, data manipulation, and potential lateral movement within the network.

🟢

If Mitigated

Limited impact with proper input validation, WAF protection, and network segmentation preventing successful exploitation.

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable and affects authentication endpoints typically exposed to the internet.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this to escalate privileges or move laterally within the network.

🎯 Exploit Status

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

Public exploit code is available on GitHub. The vulnerability requires no authentication and has simple exploitation vectors.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

1. Check SourceCodester website for updates
2. If no patch available, implement workarounds
3. Consider migrating to alternative software

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement parameterized queries and input validation in login.php

Modify login.php to use prepared statements: $stmt = $conn->prepare('SELECT * FROM users WHERE username = ? AND password = ?'); $stmt->bind_param('ss', $username, $password);

Web Application Firewall Rules

all

Block SQL injection patterns at the WAF level

Add WAF rule: SecRule ARGS "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQL Injection Attempt'"
Block patterns: UNION SELECT, OR 1=1, --, #, ;, '

🧯 If You Can't Patch

  • Isolate the system behind a reverse proxy with strict input filtering
  • Implement network segmentation to limit lateral movement if compromised

🔍 How to Verify

Check if Vulnerable:

Test login.php with SQL injection payloads like: username=admin' OR '1'='1&password=anything

Check Version:

Check system documentation or admin panel for version information

Verify Fix Applied:

Attempt SQL injection payloads and verify they are rejected or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed login attempts with SQL patterns
  • Successful logins from unusual IP addresses
  • Database error logs showing SQL syntax errors

Network Indicators:

  • HTTP requests to login.php containing SQL keywords
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri="/login.php" AND (request CONTAINS "UNION" OR request CONTAINS "OR 1=1" OR request CONTAINS "--" OR request CONTAINS "#")

🔗 References

📤 Share & Export