CVE-2024-3362
📋 TL;DR
This critical SQL injection vulnerability in SourceCodester Online Library System 1.0 allows attackers to execute arbitrary SQL commands via the IBSN parameter in admin/books/controller.php. Attackers can potentially steal, modify, or delete database contents, including sensitive library data and user credentials. The vulnerability affects all deployments of this specific software version.
💻 Affected Systems
- SourceCodester Online Library System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise leading to data theft, data destruction, authentication bypass, and potential server takeover via SQL injection to RCE chaining.
Likely Case
Unauthorized access to sensitive library data, user information theft, and potential privilege escalation within the application.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only allowing data viewing without modification.
🎯 Exploit Status
Exploit code is publicly available on GitHub. Attack requires access to the admin interface but SQL injection is straightforward once authenticated.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None known
Restart Required: No
Instructions:
No official patch available. Consider implementing input validation and parameterized queries in the affected controller.php file.
🔧 Temporary Workarounds
Input Validation and Sanitization
allAdd input validation and parameterized queries to the IBSN parameter handling in admin/books/controller.php
Edit admin/books/controller.php to implement prepared statements for all database queries involving IBSN parameter
Web Application Firewall (WAF)
allDeploy WAF rules to block SQL injection patterns targeting the IBSN parameter
Configure WAF to block SQL injection patterns in POST/GET requests to admin/books/controller.php
🧯 If You Can't Patch
- Restrict access to admin interface using IP whitelisting or VPN
- Implement database user with minimal permissions (read-only if possible)
🔍 How to Verify
Check if Vulnerable:
Check if admin/books/controller.php exists and contains unsanitized IBSN parameter usage. Test with SQL injection payloads in IBSN parameter.
Check Version:
Check software version in documentation or configuration files. Look for 'Online Library System 1.0' references.
Verify Fix Applied:
Verify that IBSN parameter is properly validated and uses parameterized queries. Test with SQL injection payloads to confirm they're blocked.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL error messages in application logs
- Multiple failed login attempts followed by admin/books/controller.php access
- SQL keywords in IBSN parameter values
Network Indicators:
- SQL injection patterns in HTTP requests to admin/books/controller.php
- Unusual database query patterns from application server
SIEM Query:
source="web_logs" AND uri="/admin/books/controller.php" AND (query_string CONTAINS "UNION" OR query_string CONTAINS "SELECT" OR query_string CONTAINS "INSERT" OR query_string CONTAINS "DELETE")
🔗 References
- https://github.com/thisissuperann/Vul/blob/main/Online-Library-System-04
- https://vuldb.com/?ctiid.259466
- https://vuldb.com/?id.259466
- https://vuldb.com/?submit.310426
- https://github.com/thisissuperann/Vul/blob/main/Online-Library-System-04
- https://vuldb.com/?ctiid.259466
- https://vuldb.com/?id.259466
- https://vuldb.com/?submit.310426