CVE-2024-3361

7.3 HIGH

📋 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

Products:
  • SourceCodester Online Library System
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the admin/books/deweydecimal.php file specifically. Requires the admin interface to be accessible.

📦 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

🌐 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 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

all

Add 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

all

Restrict 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

📤 Share & Export