CVE-2024-36779
📋 TL;DR
CVE-2024-36779 is a critical SQL injection vulnerability in Sourcecodester Stock Management System v1.0 that allows attackers to execute arbitrary SQL commands via the editCategories.php endpoint. This affects all organizations using this specific version of the software, potentially exposing sensitive database information including user credentials, inventory data, and system configurations.
💻 Affected Systems
- Sourcecodester Stock Management System
📦 What is this software?
Stock Management System by Stock Management System Project
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, authentication bypass, remote code execution via database functions, and full system takeover.
Likely Case
Unauthorized data extraction including user credentials, inventory records, and sensitive business information, potentially leading to further system compromise.
If Mitigated
Limited impact with proper input validation and parameterized queries preventing SQL injection execution.
🎯 Exploit Status
SQL injection vulnerabilities are well-understood and easily weaponized. The editCategories.php endpoint appears to lack proper input validation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: No official vendor advisory found
Restart Required: No
Instructions:
No official patch available. Consider upgrading to a newer version if available, or implement workarounds and code fixes.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict input validation and parameterized queries in editCategories.php
Modify editCategories.php to use prepared statements: $stmt = $conn->prepare('UPDATE categories SET name=? WHERE id=?'); $stmt->bind_param('si', $name, $id);
Web Application Firewall (WAF)
allDeploy WAF rules to block SQL injection patterns targeting editCategories.php
Add WAF rule: SecRule REQUEST_URI "@contains editCategories.php" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt blocked'"
🧯 If You Can't Patch
- Isolate the Stock Management System behind a reverse proxy with strict input filtering
- Implement network segmentation to limit database access from the web application server
🔍 How to Verify
Check if Vulnerable:
Test editCategories.php endpoint with SQL injection payloads like: editCategories.php?id=1' OR '1'='1
Check Version:
Check application version in admin panel or readme files
Verify Fix Applied:
Verify that parameterized queries are implemented and test with SQL injection payloads to confirm they are blocked
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in web server logs
- Multiple failed login attempts following SQL injection patterns
- Unexpected database queries from web application user
Network Indicators:
- HTTP requests to editCategories.php with SQL keywords in parameters
- Unusual database traffic patterns from web server
SIEM Query:
source="web_logs" AND uri="*editCategories.php*" AND (param="*' OR*" OR param="*UNION*" OR param="*SELECT*" OR param="*--*" OR param="*;*" OR param="*/*")