CVE-2024-3362

7.3 HIGH

📋 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

Products:
  • SourceCodester Online Library System
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the admin/books/controller.php file specifically. Any deployment with this file accessible is vulnerable.

📦 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.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

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

all

Add 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)

all

Deploy 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

📤 Share & Export