CVE-2024-5094

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in SourceCodester Best House Rental Management System 1.0 allows remote attackers to manipulate database queries through the 'id' parameter in view_payment.php. Attackers can potentially read, modify, or delete database contents, including sensitive rental and payment information. All users running the affected version are vulnerable.

💻 Affected Systems

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

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, data destruction, authentication bypass, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized access to sensitive rental data, payment information, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permissions restricting damage to non-critical data.

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable and public exploit code exists, making internet-facing instances immediate targets.
🏢 Internal Only: MEDIUM - Internal systems are still vulnerable but require network access; risk increases if attackers gain internal foothold.

🎯 Exploit Status

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

Public exploit code is available on GitHub; SQL injection via 'id' parameter requires minimal technical skill to execute.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

1. Check SourceCodester website for updates 2. If patch available, download and replace affected files 3. Test functionality after patching

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to ensure 'id' parameter contains only numeric values

In view_payment.php, add: if(!is_numeric($_GET['id'])) { die('Invalid input'); }

WAF Rule Implementation

all

Deploy web application firewall rules to block SQL injection patterns

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

🧯 If You Can't Patch

  • Isolate the system behind a reverse proxy with strict input validation
  • Implement database-level controls: restrict application database user permissions to SELECT only

🔍 How to Verify

Check if Vulnerable:

Test view_payment.php with SQL injection payloads in 'id' parameter: view_payment.php?id=1' OR '1'='1

Check Version:

Check application files for version markers or review source code comments

Verify Fix Applied:

Test with same payloads; application should reject invalid input or return error without database interaction

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests to view_payment.php with special characters in parameters
  • Database queries with UNION, SELECT, or other SQL keywords from unexpected sources

Network Indicators:

  • HTTP requests with SQL injection patterns in 'id' parameter
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri="*view_payment.php*" AND (param="*id=*'*" OR param="*id=*%27*" OR param="*id=*UNION*" OR param="*id=*SELECT*")

🔗 References

📤 Share & Export