CVE-2024-4912

6.3 MEDIUM

📋 TL;DR

This critical SQL injection vulnerability in Campcodes Online Examination System 1.0 allows attackers to manipulate database queries through the examTitle parameter in addExamExe.php. Remote attackers can potentially access, modify, or delete sensitive examination data. All deployments of version 1.0 are affected.

💻 Affected Systems

Products:
  • Campcodes Online Examination System
Versions: 1.0
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Any installation using the default configuration is vulnerable. The vulnerability exists in the core application code.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including credential theft, data destruction, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized access to examination data, student records, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error messages or minor data exposure.

🌐 Internet-Facing: HIGH - Remote exploitation is possible without authentication, making internet-facing instances particularly vulnerable.
🏢 Internal Only: MEDIUM - Internal attackers could still exploit this, but requires network access to the application.

🎯 Exploit Status

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

Public exploit code is available on GitHub, making this easily exploitable by attackers with basic SQL injection knowledge.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Consider migrating to a maintained alternative or implementing workarounds.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement parameterized queries or prepared statements for the examTitle parameter in addExamExe.php

Modify addExamExe.php to use prepared statements: $stmt = $conn->prepare('INSERT INTO exams (title) VALUES (?)'); $stmt->bind_param('s', $examTitle);

Web Application Firewall Rules

all

Block SQL injection patterns targeting the addExamExe.php endpoint

WAF rule to block: "examTitle.*(SELECT|UNION|INSERT|UPDATE|DELETE|DROP|ALTER)"

🧯 If You Can't Patch

  • Isolate the application behind a reverse proxy with strict input validation
  • Implement network segmentation and restrict database access to only necessary application components

🔍 How to Verify

Check if Vulnerable:

Test the addExamExe.php endpoint with SQL injection payloads in the examTitle parameter (e.g., examTitle=test' OR '1'='1)

Check Version:

Check application version in admin panel or readme files; system is vulnerable if version is 1.0

Verify Fix Applied:

Verify that parameterized queries are implemented and SQL injection attempts return proper error handling without database interaction

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed SQL queries from same source
  • Unusual database access patterns
  • Error logs showing SQL syntax errors

Network Indicators:

  • HTTP POST requests to addExamExe.php containing SQL keywords in parameters
  • Unusual database port traffic from web server

SIEM Query:

source="web_logs" AND uri="/addExamExe.php" AND (param="*SELECT*" OR param="*UNION*" OR param="*INSERT*" OR param="*DROP*")

🔗 References

📤 Share & Export