CVE-2024-4798

6.3 MEDIUM

📋 TL;DR

This is a critical SQL injection vulnerability in SourceCodester Online Computer and Laptop Store 1.0 that allows attackers to execute arbitrary SQL commands via the 'id' parameter in the /admin/maintenance/manage_brand.php file. Attackers can exploit this remotely to potentially access, modify, or delete database content. All users running this specific software version are affected.

💻 Affected Systems

Products:
  • SourceCodester Online Computer and Laptop Store
Versions: 1.0
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires the /admin/maintenance/manage_brand.php file to be accessible

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, data destruction, or full system takeover via SQL injection to RCE chaining

🟠

Likely Case

Unauthorized database access allowing extraction of sensitive information like user credentials, payment data, or administrative access

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - Attack can be launched remotely without authentication
🏢 Internal Only: MEDIUM - Still exploitable from internal networks but attack surface is reduced

🎯 Exploit Status

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

Exploit code is publicly available on GitHub, making this easily weaponizable by attackers

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Consider implementing parameterized queries or input validation as workaround.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add input validation to sanitize the 'id' parameter before processing

Modify manage_brand.php to validate id parameter using is_numeric() or similar functions

Web Application Firewall Rules

all

Block SQL injection patterns targeting the manage_brand.php endpoint

Add WAF rule: deny requests to /admin/maintenance/manage_brand.php with SQL injection patterns in parameters

🧯 If You Can't Patch

  • Restrict access to /admin/maintenance/manage_brand.php using IP whitelisting or authentication
  • Implement database user with minimal permissions (read-only if possible) for the application

🔍 How to Verify

Check if Vulnerable:

Test the /admin/maintenance/manage_brand.php endpoint with SQL injection payloads in the id parameter (e.g., id=1' OR '1'='1)

Check Version:

Check software version in admin panel or configuration files

Verify Fix Applied:

Test with SQL injection payloads and verify they are rejected or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests to manage_brand.php with suspicious parameters
  • Database query errors containing SQL syntax

Network Indicators:

  • HTTP requests to /admin/maintenance/manage_brand.php with SQL keywords in parameters
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri="/admin/maintenance/manage_brand.php" AND (param="id" AND value MATCH "[';]|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR.*=.*")

🔗 References

📤 Share & Export