CVE-2020-36033

9.8 CRITICAL

📋 TL;DR

This vulnerability allows attackers to execute arbitrary SQL commands through the id parameter in edituser.php in Water Billing System 1.0. This can lead to unauthorized data access, modification, or deletion. Organizations using this specific billing system version are affected.

💻 Affected Systems

Products:
  • SourceCodester Water Billing System
Versions: 1.0
Operating Systems: Any OS running PHP and MySQL/MariaDB
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of version 1.0. The system appears to be a PHP/MySQL web application.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data destruction, and potential server takeover via SQL injection leading to remote code execution.

🟠

Likely Case

Unauthorized access to sensitive user data, billing records, and potential privilege escalation to administrative accounts.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only allowing data viewing without modification.

🌐 Internet-Facing: HIGH - The vulnerability is in a web application component that is typically internet-facing, allowing remote exploitation.
🏢 Internal Only: MEDIUM - Even internally, this could be exploited by malicious insiders or through lateral movement from compromised systems.

🎯 Exploit Status

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

SQL injection vulnerabilities are commonly exploited and tools like sqlmap can automate exploitation. The vulnerability is in a parameter that likely doesn't require authentication.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: No official vendor advisory found

Restart Required: No

Instructions:

1. Check for updated version from SourceCodester. 2. If no patch available, implement parameterized queries in edituser.php. 3. Replace direct SQL concatenation with prepared statements. 4. Add input validation for the id parameter.

🔧 Temporary Workarounds

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection protection rules to block malicious requests.

Input Validation Filter

all

Add server-side validation to only accept numeric values for the id parameter.

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

🧯 If You Can't Patch

  • Isolate the system on a separate network segment with strict access controls
  • Implement database-level controls: use least privilege accounts, enable audit logging, and restrict database permissions

🔍 How to Verify

Check if Vulnerable:

Test the edituser.php endpoint with SQL injection payloads like: edituser.php?id=1' OR '1'='1

Check Version:

Check the software version in the application interface or configuration files.

Verify Fix Applied:

Test with the same payloads and verify they are rejected or properly handled without SQL errors.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in web server logs
  • Multiple requests to edituser.php with suspicious parameters
  • Database queries with UNION, SELECT, or other SQL keywords from web requests

Network Indicators:

  • HTTP requests containing SQL keywords in URL parameters
  • Unusual traffic patterns to the edituser.php endpoint

SIEM Query:

source="web_server_logs" AND (url="*edituser.php*" AND (param="*id=*'*" OR param="*id=*%27*" OR param="*id=* UNION *" OR param="*id=* SELECT *"))

🔗 References

📤 Share & Export