CVE-2025-4504
📋 TL;DR
This critical SQL injection vulnerability in SourceCodester Online College Library System 1.0 allows attackers to manipulate database queries through the Category parameter in /index.php. Remote attackers can potentially access, modify, or delete database contents. All deployments of version 1.0 are affected.
💻 Affected Systems
- SourceCodester Online College Library System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including data theft, data manipulation, authentication bypass, and potential remote code execution via database functions.
Likely Case
Unauthorized data access and extraction of sensitive information like user credentials, personal data, and library records.
If Mitigated
Limited impact if proper input validation and WAF rules block malicious SQL payloads.
🎯 Exploit Status
Public exploit available on GitHub. SQL injection via Category parameter requires minimal technical skill.
🛠️ 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 Filter
allAdd parameter validation to sanitize Category input before processing
Modify /index.php to validate Category parameter using prepared statements or whitelist validation
WAF Rule Implementation
allDeploy web application firewall rules to block SQL injection patterns
Add WAF rule: Detect and block SQL keywords in Category parameter
🧯 If You Can't Patch
- Isolate the system behind a reverse proxy with strict input validation
- Implement network segmentation to limit database access from web server
🔍 How to Verify
Check if Vulnerable:
Test /index.php with Category parameter containing SQL injection payload like ' OR '1'='1
Check Version:
Check system version in admin panel or readme files
Verify Fix Applied:
Verify that SQL injection payloads no longer execute and return error pages
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in web server logs
- Multiple requests with SQL keywords in Category parameter
Network Indicators:
- HTTP requests containing SQL injection patterns in Category parameter
SIEM Query:
source="web_logs" AND (uri_path="/index.php" AND query_string="*Category=*SQL*" OR query_string="*Category=*' OR *")