CVE-2023-31845

7.2 HIGH

📋 TL;DR

CVE-2023-31845 is an SQL injection vulnerability in Sourcecodester Faculty Evaluation System v1.0, allowing attackers to execute arbitrary SQL commands via the 'id' parameter in /eval/admin/manage_class.php. This affects all users running the vulnerable version, potentially compromising database integrity and confidentiality.

💻 Affected Systems

Products:
  • Sourcecodester Faculty Evaluation System
Versions: v1.0
Operating Systems: Any OS running the web application (e.g., Linux, Windows)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability is in the default installation; no special configuration required.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise leading to data theft, unauthorized access, or complete system takeover.

🟠

Likely Case

Data exfiltration, such as stealing user credentials or sensitive information from the database.

🟢

If Mitigated

Limited impact if input validation and parameterized queries are enforced, preventing SQL execution.

🌐 Internet-Facing: HIGH if the system is exposed to the internet, as it allows remote exploitation without authentication.
🏢 Internal Only: MEDIUM if restricted to internal networks, but still poses risk from insider threats or compromised internal systems.

🎯 Exploit Status

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

Exploitation is straightforward via crafted HTTP requests to the vulnerable endpoint.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not known

Restart Required: No

Instructions:

No official patch; apply workarounds or upgrade if a newer version is released.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement server-side validation to sanitize the 'id' parameter, rejecting malicious inputs.

Modify PHP code to use prepared statements, e.g., $stmt = $conn->prepare('SELECT * FROM classes WHERE id = ?'); $stmt->bind_param('i', $id);

Web Application Firewall (WAF) Rules

all

Deploy WAF rules to block SQL injection patterns in requests to /eval/admin/manage_class.php.

Configure WAF to detect and block SQL keywords like UNION, SELECT, OR 1=1 in URL parameters.

🧯 If You Can't Patch

  • Restrict access to the vulnerable endpoint using network ACLs or authentication.
  • Monitor and log all access to /eval/admin/manage_class.php for suspicious activity.

🔍 How to Verify

Check if Vulnerable:

Send a test request to /eval/admin/manage_class.php?id=1' OR '1'='1 and check for SQL errors or unexpected responses.

Check Version:

Check the application's version in its documentation or configuration files; no standard command available.

Verify Fix Applied:

After applying workarounds, retest with the same payload; it should return an error or no data without executing SQL.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in web server logs, repeated requests with SQL-like parameters to manage_class.php.

Network Indicators:

  • HTTP requests containing SQL injection payloads in the 'id' parameter.

SIEM Query:

Example: source="web_logs" AND uri="/eval/admin/manage_class.php" AND (param="id" AND value MATCHES "'.*OR.*'" OR value MATCHES "'.*UNION.*'");

🔗 References

📤 Share & Export