Overview
The Dormitory Management System 1.0, a project managed by code-projects, has been found to have a critical SQL injection vulnerability (CVE-2024-0474) associated with an unknown functionality of the file login.php. The vulnerability can be exploited remotely and has been disclosed publicly, raising the risk of potential system compromises or data leaks.
Vulnerability Summary
CVE ID: CVE-2024-0474
Severity: Critical, CVSS Score 7.3
Attack Vector: Network
Privileges Required: None
User Interaction: None
Impact: System compromise, potential data leakage
Affected Products
Product | Affected Versions
Dormitory Management System | 1.0
How the Exploit Works
This vulnerability stems from an insufficient input validation mechanism in the login.php file. An attacker can manipulate the ‘username’ argument to inject malicious SQL commands. Since the input isn’t properly sanitized, the server executes the malicious SQL command, leading to unauthorized database access.
Conceptual Example Code
An example of how the vulnerability might be exploited is shown below. This is a hypothetical SQL injection attack in the ‘username’ field:
POST /login.php HTTP/1.1
Host: target.example.com
Content-Type: application/x-www-form-urlencoded
username=' OR '1'='1'; -- &password=123
In this example, the attacker manipulates the ‘username’ field to include a SQL command that will always return true (`’ OR ‘1’=’1′; –`). This allows them to bypass the authentication mechanism, gaining unauthorized access.
Mitigation Guidance
To mitigate this vulnerability, users are advised to apply the vendor-released patch. In the absence of a patch, implementing a Web Application Firewall (WAF) or Intrusion Detection System (IDS) can serve as temporary mitigation, but a permanent solution should be sought. The WAF or IDS should be configured to detect and block SQL injection attempts.
