Summary
Online Enrollment System 1.0 contains a SQL injection flaw in the /enrollment/index.php?view=add endpoint, where user-controlled parameters such as txtsearch, deptname, and name are inserted into SQL queries without proper sanitization.
A remote attacker can exploit this to manipulate database queries, potentially accessing, modifying, or deleting enrollment-related data when the vulnerable page processes crafted input.
Affected context
The vulnerability occurs in the web-based enrollment workflow exposed by index.php when the view=add parameter is used.
In this context, the application appears to accept search or form input parameters (txtsearch, deptname, name) that influence database operations.
When these values are passed directly into SQL statements without proper parameterization or escaping, the application becomes susceptible to SQL injection.
Exploit preconditions
- Attack surface: Public-facing web interface at
/enrollment/index.php?view=add - Required access: Network access to the enrollment application (typically via HTTP/HTTPS); no prior authentication may be required if the endpoint is publicly reachable
- Trigger point: Submission of crafted values in
txtsearch,deptname, orname(via query string or form fields) that are later interpolated into SQL queries - Why exploitation is possible: The backend logic constructs SQL statements by concatenating untrusted input into query strings instead of using parameterized queries, allowing attackers to alter the SQL command structure
Why this happens
This issue stems from building SQL queries dynamically with unvalidated, untrusted input from HTTP parameters.
Rather than binding user input as data parameters, the code likely concatenates variables directly into query strings, a classic CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') pattern.
The presence of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component reflects that data is not properly sanitized before being consumed by the database, which trusts the input as part of the command syntax rather than treating it strictly as data.
Potential impact
- Attackers may read sensitive enrollment records and associated personal information
- Attackers could modify or delete student, department, or course data, impacting data integrity
- Attackers may create or escalate user accounts stored in the database
- Attackers could potentially execute database-specific functions leading to further compromise of the hosting environment, depending on database configuration
General mitigation guidance
Effective mitigation generally focuses on treating all user input as untrusted and isolating it from SQL command construction:
- Use parameterized queries or prepared statements for all database interactions, ensuring user input is bound as data, not concatenated into SQL strings
- Apply central input validation for search and form fields, enforcing allowed characters and expected formats (e.g., alphanumeric for names and department identifiers)
- Implement output encoding or query builder abstractions that disallow direct string concatenation for SQL commands
- Restrict database privileges to the minimum necessary, so the application account cannot perform dangerous operations (e.g., dropping tables, altering schema)
- Introduce secure-by-default data access layers that abstract raw SQL away from presentation logic
How teams detect issues like this
Organizations can detect and monitor for SQL injection issues in several ways:
- Static application security testing (SAST) targeting patterns of string-concatenated SQL queries, especially where HTTP parameters flow directly into query construction
- Manual code review focusing on database access layers and any use of dynamic SQL or interpolated query strings
- Use of web application firewalls (WAF) or runtime application self-protection (RASP) solutions to flag or block suspicious query patterns in HTTP requests
- Database monitoring for anomalous or highly variable SQL statements originating from the enrollment application
- CI/CD pipeline checks that enforce use of parameterized query APIs and flag direct concatenation of user-controlled variables into SQL

