CVE-2024-28558

8.8 HIGH

📋 TL;DR

This SQL injection vulnerability in Petrol Pump Management Software v1.0 allows remote attackers to execute arbitrary SQL commands via the admin/app/web_crud.php endpoint. Attackers can potentially read, modify, or delete database content, escalate privileges, and execute arbitrary code. All users running the vulnerable software version are affected.

💻 Affected Systems

Products:
  • SourceCodester Petrol Pump Management Software
Versions: v1.0
Operating Systems: Any OS running PHP web server
Default Config Vulnerable: ⚠️ Yes
Notes: Affects default installation with no additional security hardening.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise including arbitrary code execution, privilege escalation to admin, database exfiltration, and potential lateral movement to other systems.

🟠

Likely Case

Database compromise leading to sensitive information disclosure (customer data, financial records), privilege escalation, and potential website defacement.

🟢

If Mitigated

Limited impact with proper input validation and WAF in place, potentially only error messages or partial data exposure.

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable via web interface with no authentication required.
🏢 Internal Only: HIGH - Even internal systems are vulnerable to authenticated or unauthenticated attacks.

🎯 Exploit Status

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

Public proof-of-concept available on GitHub, exploitation requires basic SQL injection knowledge.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Consider replacing with alternative software or implementing custom fixes.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement parameterized queries and input validation for all user inputs in web_crud.php

Modify PHP code to use prepared statements: $stmt = $conn->prepare('SELECT * FROM table WHERE id = ?'); $stmt->bind_param('i', $id);

Web Application Firewall (WAF)

linux

Deploy WAF with SQL injection rules to block malicious payloads

Install and configure ModSecurity with OWASP Core Rule Set

🧯 If You Can't Patch

  • Isolate the system behind a reverse proxy with strict input filtering
  • Implement network segmentation to limit database access from web server

🔍 How to Verify

Check if Vulnerable:

Test the admin/app/web_crud.php endpoint with SQL injection payloads like ' OR '1'='1

Check Version:

Check software version in admin panel or readme files

Verify Fix Applied:

Verify that SQL injection payloads no longer execute and return error messages

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts
  • Suspicious POST requests to web_crud.php

Network Indicators:

  • SQL keywords in HTTP POST parameters
  • Unusual database connection patterns

SIEM Query:

source=web_logs AND (uri="*web_crud.php*" AND (param="*' OR*" OR param="*UNION*" OR param="*SELECT*"))

🔗 References

📤 Share & Export