CVE-2024-3361
📋 TL;DR
CVE-2024-3361 is a critical SQL injection vulnerability in SourceCodester Online Library System 1.0 that allows remote attackers to execute arbitrary SQL commands via the 'category' parameter in admin/books/deweydecimal.php. This affects all deployments of the vulnerable software version. Attackers can potentially access, modify, or delete database content.
💻 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, or full system takeover via SQL injection to RCE chain
Likely Case
Unauthorized database access allowing extraction of sensitive information like user credentials, personal data, and system configuration
If Mitigated
Limited impact with proper input validation and database permissions restricting damage to non-critical data
🎯 Exploit Status
Exploit code is publicly available on GitHub. Attack requires access to admin interface but not necessarily authentication if other vulnerabilities exist.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: None known
Restart Required: No
Instructions:
1. Check vendor website for updates 2. Apply parameterized queries or input validation 3. Replace vulnerable file with secure version
🔧 Temporary Workarounds
Input Validation Filter
allAdd input validation to filter SQL injection attempts in the category parameter
Modify admin/books/deweydecimal.php to sanitize $_GET['category'] or $_POST['category'] using prepared statements
Access Restriction
allRestrict access to the vulnerable admin interface
Add .htaccess authentication or IP whitelisting to admin directory
🧯 If You Can't Patch
- Implement WAF rules to block SQL injection patterns targeting the deweydecimal.php endpoint
- Isolate the system from internet access and restrict to internal network only
🔍 How to Verify
Check if Vulnerable:
Test the admin/books/deweydecimal.php endpoint with SQL injection payloads in the category parameter
Check Version:
Check system documentation or configuration files for version information
Verify Fix Applied:
Verify that parameterized queries are implemented and SQL injection attempts are properly rejected
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL queries in database logs
- Multiple failed login attempts to admin interface
- Requests to deweydecimal.php with suspicious parameters
Network Indicators:
- SQL error messages in HTTP responses
- Unusual database connection patterns from web server
SIEM Query:
source="web_logs" AND uri="/admin/books/deweydecimal.php" AND (param="category" AND value MATCHES "(?i)(union|select|insert|delete|update|drop|--|#|/*)")
🔗 References
- https://github.com/thisissuperann/Vul/blob/main/Online-Library-System-03
- https://vuldb.com/?ctiid.259465
- https://vuldb.com/?id.259465
- https://vuldb.com/?submit.310425
- https://github.com/thisissuperann/Vul/blob/main/Online-Library-System-03
- https://vuldb.com/?ctiid.259465
- https://vuldb.com/?id.259465
- https://vuldb.com/?submit.310425