CVE-2025-8987
📋 TL;DR
This vulnerability allows remote attackers to execute SQL injection attacks against the SourceCodester COVID 19 Testing Management System 1.0 by manipulating the 'remark' parameter in the /test-details.php file. Attackers can potentially access, modify, or delete database content. Organizations using this specific software version are affected.
💻 Affected Systems
- SourceCodester COVID 19 Testing Management System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, data manipulation, or system takeover via SQL injection to execute arbitrary commands.
Likely Case
Unauthorized access to sensitive COVID testing data, patient information exposure, or database manipulation.
If Mitigated
Limited impact with proper input validation, parameterized queries, and network segmentation in place.
🎯 Exploit Status
Exploit details are publicly available on GitHub, making this easily exploitable by attackers.
🛠️ 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 implement workarounds.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict input validation and parameterized queries for the 'remark' parameter in test-details.php
Modify PHP code to use prepared statements: $stmt = $conn->prepare('SELECT * FROM table WHERE remark = ?'); $stmt->bind_param('s', $remark);
Web Application Firewall (WAF) Rules
allDeploy WAF rules to block SQL injection patterns targeting the /test-details.php endpoint
Add WAF rule: Block requests to /test-details.php with SQL injection patterns in parameters
🧯 If You Can't Patch
- Isolate the system from internet access and restrict to internal network only
- Implement strict network segmentation and monitor all access to the vulnerable endpoint
🔍 How to Verify
Check if Vulnerable:
Test the /test-details.php endpoint with SQL injection payloads in the 'remark' parameter and observe database errors or unexpected behavior.
Check Version:
Check the software version in the admin panel or configuration files, typically in config.php or similar files.
Verify Fix Applied:
After implementing parameterized queries, test with SQL injection payloads and verify no database errors or unauthorized access occurs.
📡 Detection & Monitoring
Log Indicators:
- SQL syntax errors in web server logs
- Unusual database queries from web application
- Multiple failed login attempts or parameter manipulation
Network Indicators:
- HTTP requests to /test-details.php with SQL keywords in parameters
- Unusual database connection patterns from web server
SIEM Query:
source="web_server" AND uri="/test-details.php" AND (param="remark" AND value CONTAINS "UNION" OR value CONTAINS "SELECT" OR value CONTAINS "OR 1=1")