CVE-2025-12257

7.3 HIGH

📋 TL;DR

This SQL injection vulnerability in SourceCodester Online Student Result System 1.0 allows attackers to manipulate database queries through the ID parameter in /view_result.php. Remote attackers can potentially access, modify, or delete student result data. All deployments of version 1.0 are affected.

💻 Affected Systems

Products:
  • SourceCodester Online Student Result System
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All installations of version 1.0 are vulnerable. The vulnerability exists in the default installation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including student records, grades, personal information, and potential system takeover via SQL injection leading to remote code execution.

🟠

Likely Case

Unauthorized access to student result data, grade manipulation, and potential extraction of sensitive information from the database.

🟢

If Mitigated

Limited impact with proper input validation and database permissions restricting query execution.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Public exploit available on GitHub. Simple SQL injection via ID parameter manipulation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://www.sourcecodester.com/

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available or implementing workarounds.

🔧 Temporary Workarounds

Input Validation and Parameterized Queries

all

Implement proper input validation and use parameterized queries in /view_result.php

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

Web Application Firewall (WAF)

all

Deploy WAF rules to block SQL injection patterns

Add WAF rule: SecRule ARGS:id "@detectSQLi" "id:1001,phase:2,deny"

🧯 If You Can't Patch

  • Restrict access to /view_result.php to authenticated users only
  • Implement network segmentation to isolate the system from untrusted networks

🔍 How to Verify

Check if Vulnerable:

Test /view_result.php with SQL injection payloads like: /view_result.php?id=1' OR '1'='1

Check Version:

Check system version in admin panel or readme files

Verify Fix Applied:

Test with same payloads after implementing parameterized queries - should return error or no data

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in PHP logs
  • Multiple requests to /view_result.php with suspicious ID parameters
  • Database query errors containing single quotes or SQL keywords

Network Indicators:

  • HTTP requests to /view_result.php with SQL injection patterns in parameters
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri="/view_result.php" AND (param_id CONTAINS "'" OR param_id CONTAINS "OR" OR param_id CONTAINS "UNION")

🔗 References

📤 Share & Export