CVE-2024-36568

9.8 CRITICAL

📋 TL;DR

CVE-2024-36568 is a critical SQL injection vulnerability in Sourcecodester Gas Agency Management System v1.0 that allows attackers to execute arbitrary SQL commands via the 'id' parameter in /gasmark/editbrand.php. This affects all organizations using the vulnerable version of this management system software.

💻 Affected Systems

Products:
  • Sourcecodester Gas Agency Management System
Versions: v1.0
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Affects default installation with no modifications to the vulnerable file.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, authentication bypass, and potential remote code execution through database functions.

🟠

Likely Case

Database information disclosure, data manipulation, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error-based information disclosure.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires authentication to access the vulnerable endpoint, but SQL injection payloads are straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Implement workarounds or manually fix the vulnerable code by adding proper input validation and parameterized queries.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add server-side validation to sanitize the 'id' parameter before processing.

Edit /gasmark/editbrand.php and add: $id = intval($_GET['id']);

Web Application Firewall (WAF)

all

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

🧯 If You Can't Patch

  • Restrict access to /gasmark/editbrand.php using IP whitelisting or authentication requirements.
  • Implement database user with minimal privileges (read-only if possible) for the application.

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

Check the software version in the admin panel or configuration files.

Verify Fix Applied:

Test with SQL injection payloads after implementing fixes; should return error or no data manipulation.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests to /gasmark/editbrand.php with suspicious parameters

Network Indicators:

  • HTTP requests containing SQL keywords (UNION, SELECT, etc.) in URL parameters

SIEM Query:

source="web_logs" AND uri="/gasmark/editbrand.php" AND (param="%27" OR param="--" OR param="UNION" OR param="SELECT")

🔗 References

📤 Share & Export