CVE-2024-1829

7.3 HIGH

📋 TL;DR

This critical SQL injection vulnerability in code-projects Library System 1.0 allows attackers to manipulate database queries through the student registration form. Remote attackers can potentially access, modify, or delete sensitive library data. All deployments of Library System 1.0 with the vulnerable student registration functionality are affected.

💻 Affected Systems

Products:
  • code-projects Library System
Versions: 1.0
Operating Systems: All platforms running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the student registration functionality specifically in the registration.php file. Any deployment with this file accessible is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including exfiltration of sensitive user data, administrative credentials theft, and potential system takeover through privilege escalation.

🟠

Likely Case

Data exfiltration of student records, manipulation of library data, and potential authentication bypass to gain unauthorized access.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries preventing successful exploitation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Public exploit details available on GitHub. SQL injection via email, regno, phone, and username parameters requires minimal technical skill to execute.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Implement parameterized queries and input validation in registration.php. Replace raw SQL queries with prepared statements using PDO or mysqli.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add server-side validation and sanitization for email, regno, phone, and username parameters before database queries.

Edit Source/librarian/user/student/registration.php to implement parameterized queries

Web Application Firewall Rules

all

Deploy WAF rules to block SQL injection patterns targeting the registration endpoint.

Add WAF rules to detect and block SQL injection attempts on /librarian/user/student/registration.php

🧯 If You Can't Patch

  • Restrict network access to the Library System to trusted IP addresses only
  • Disable student registration functionality if not required

🔍 How to Verify

Check if Vulnerable:

Test the registration form with SQL injection payloads in email, regno, phone, or username fields and observe database errors or unexpected behavior.

Check Version:

Check the software version in documentation or configuration files. Look for 'Library System 1.0' references.

Verify Fix Applied:

Attempt SQL injection after implementing parameterized queries - successful fix should return proper error messages without database exposure.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL syntax in POST parameters to registration.php
  • Database error messages in application logs
  • Multiple failed registration attempts with special characters

Network Indicators:

  • POST requests to /librarian/user/student/registration.php containing SQL keywords (UNION, SELECT, INSERT, etc.)
  • Abnormal traffic patterns to registration endpoint

SIEM Query:

source="web_logs" AND uri="/librarian/user/student/registration.php" AND (request_body CONTAINS "UNION" OR request_body CONTAINS "SELECT" OR request_body CONTAINS "INSERT" OR request_body CONTAINS "DELETE")

🔗 References

📤 Share & Export