Summary
Online Enrollment System 1.0 contains a SQL injection vulnerability in /sms/login.php where the user_email parameter is incorporated into database queries without proper sanitization.
A remote attacker can send crafted login requests to manipulate the underlying SQL query, which may lead to authentication bypass, information disclosure, or modification of enrollment data.
Affected context
The vulnerability occurs in the login functionality of the Online Enrollment System 1.0, specifically within the /sms/login.php endpoint.
It is present when the application constructs SQL statements using the user_email request parameter directly, without parameterization or robust input validation.
Any deployment where /sms/login.php is exposed to users over a network and backed by a relational database is potentially affected.
Exploit preconditions
- Attack surface: Network-exposed web interface at /sms/login.php
- Required access: Ability to send HTTP requests to the login endpoint (no prior authentication assumed)
- Trigger point: Submission of crafted values in the user_email parameter during login
- Why exploitation is possible: The server-side code appears to dynamically build SQL queries using raw user-controlled input, allowing injection of additional SQL syntax into the query execution path.
Why this happens
This issue stems from constructing SQL queries by concatenating or interpolating the user_email parameter directly into the query string.
Such patterns violate the principle of separating code from data and align with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The mention of CWE-74 (Improper Neutralization of Special Elements in Output) reflects broader inadequate neutralization of special characters, but the primary bug class is unparameterized SQL, which allows attacker-controlled input to alter query structure.
Potential impact
- An attacker may bypass login checks and impersonate other users or administrative accounts.
- An attacker could retrieve sensitive information from the enrollment database, such as student records, contact details, or internal system data.
- An attacker can modify or delete enrollment records, impacting data integrity and system reliability.
- Under certain configurations, an attacker might chain this issue with other weaknesses for broader system compromise.
General mitigation guidance
Effective mitigation focuses on treating all request parameters, including user_email, as untrusted input and ensuring the database layer enforces strict separation between query logic and data.
Common defensive patterns include:
- Using prepared statements with bound parameters or ORM query builders that avoid raw string concatenation.
- Applying centralized, whitelist-based validation for email-like inputs and rejecting values that do not meet expected formats.
- Implementing least-privilege database accounts so that even if a query is abused, the account cannot perform unsafe operations (such as dropping tables or accessing unrelated schemas).
- Encapsulating database access behind a well-reviewed data access layer, reducing direct ad-hoc query construction in presentation code like login.php.
How teams detect issues like this
Detection typically combines code-centric review with runtime signals:
- Static analysis rules looking for dynamic SQL construction involving $_GET, $_POST, or other request variables, especially for user_email in login-related scripts.
- Manual code review focusing on /sms/login.php and similar entry points, flagging any concatenation of user-controlled variables into SQL strings.
- Web application firewall (WAF) or reverse proxy rules that log and optionally block suspicious SQL meta-characters or patterns in login parameters.
- Application-level logging and anomaly detection around failed logins, unusual query patterns, and unexpected result sets that may indicate probing for SQL injection.

