CVE-2024-24142

9.8 CRITICAL

📋 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

Products:
  • Sourcecodester School Task Manager
Versions: 1.0
Operating Systems: Any OS running PHP/MySQL web server
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all installations of version 1.0 regardless of configuration.

📦 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.

🌐 Internet-Facing: HIGH - Web applications are typically internet-facing, making them directly accessible to attackers.
🏢 Internal Only: MEDIUM - Internal deployments still vulnerable to insider threats or compromised internal systems.

🎯 Exploit Status

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

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

all

Implement 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)

all

Deploy 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"

🔗 References

📤 Share & Export