CVE-2024-24142
📋 TL;DR
CVE-2024-24142 is a critical SQL injection vulnerability in School Task Manager 1.0 that allows attackers to execute arbitrary SQL commands via the 'subject' parameter. This affects all users running the vulnerable version of this web application. Successful exploitation could lead to complete database compromise.
💻 Affected Systems
- Sourcecodester School Task Manager
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database takeover allowing data theft, modification, deletion, and potential remote code execution on the database server.
Likely Case
Unauthorized access to sensitive student/teacher data, grade manipulation, and potential privilege escalation within the application.
If Mitigated
Limited to error-based SQL injection with partial data exposure if input validation is partially implemented.
🎯 Exploit Status
Public GitHub repository demonstrates exploitation. SQL injection via GET/POST parameter requires minimal technical skill.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None found
Restart Required: No
Instructions:
No official patch available. Consider migrating to alternative software or implementing workarounds.
🔧 Temporary Workarounds
Input Validation and Parameterized Queries
allImplement proper input validation and use prepared statements/parameterized queries for all database operations.
// PHP example using PDO prepared statements
$stmt = $pdo->prepare('SELECT * FROM tasks WHERE subject = :subject');
$stmt->execute(['subject' => $_POST['subject']]);
Web Application Firewall (WAF)
allDeploy WAF with SQL injection rules to block malicious requests.
# ModSecurity example rule
SecRule ARGS:subject "@detectSQLi" "id:1001,phase:2,deny,status:403"
🧯 If You Can't Patch
- Isolate the application behind a reverse proxy with strict input filtering
- Implement network segmentation to limit database server access
🔍 How to Verify
Check if Vulnerable:
Test the 'subject' parameter with SQL injection payloads like ' OR '1'='1 and observe database errors or unexpected behavior.
Check Version:
Check application files for version information or review source code comments.
Verify Fix Applied:
Attempt SQL injection tests and verify they are blocked or sanitized without affecting legitimate functionality.
📡 Detection & Monitoring
Log Indicators:
- SQL syntax errors in application logs
- Unusual database query patterns
- Multiple failed login attempts via SQL injection
Network Indicators:
- HTTP requests containing SQL keywords in parameters
- Unusual database port traffic from web server
SIEM Query:
source="web_logs" AND ("sql" OR "union" OR "select" OR "insert" OR "update" OR "delete") AND parameter="subject"