Summary
The Online Student Enrollment System v1.0 contains a SQL injection flaw in instructorClasses.php, where the classId parameter from user-controlled GET input is directly concatenated into a SQL query.
An attacker who can send crafted HTTP requests to this endpoint may be able to manipulate database queries, leading to data exposure, tampering, or complete compromise of the application's underlying database.
Affected context
This vulnerability occurs in deployments of the Online Student Enrollment System v1.0 that expose the instructorClasses.php script over HTTP/S and accept a classId parameter via the query string.
The issue is present where application code builds SQL statements by directly concatenating $_GET['classId'] into the query without applying parameterization, input validation, or escaping.
It is relevant in environments where the web application account has permission to read or modify sensitive enrollment, student, or instructor records in the backing database.
Exploit preconditions
- Attack surface: Web interface, specifically requests hitting
instructorClasses.php. - Required access: Network access to the web application; no authenticated session may be required if the vulnerable script is reachable anonymously.
- Trigger point: Supplying a crafted
classIdvalue via the URL query string (e.g.,?classId=...) so that it is processed by$_GET['classId']and interpolated into a SQL query. - Why exploitation is possible: The application constructs SQL statements by string concatenation using untrusted input, without prepared statements, proper escaping, or type enforcement, allowing attackers to alter the intended query structure.
Why this happens
The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
In the affected code, the classId parameter is taken directly from $_GET['classId'] and concatenated into the SQL command text.
This pattern treats user-controlled data as part of the SQL language rather than as a value, so injected characters such as quotes, operators, and comment markers can terminate existing clauses or introduce new ones.
The absence of prepared statements, input binding, and robust validation allows the database to interpret attacker-supplied content as executable SQL logic.
Potential impact
- Attackers may extract sensitive student, instructor, and enrollment data from the database.
- An attacker could modify or delete enrollment records, grades, or class information.
- The database account used by the application might be leveraged to create new accounts or escalate privileges within the application.
- In some environments, the attacker could execute database-specific commands that impact availability or interact with the underlying operating system, depending on configuration.
- Compromise of data integrity, leading to falsified academic records or disrupted enrollment processes.
General mitigation guidance
Effective mitigation focuses on removing direct concatenation of untrusted data into SQL and tightening data handling boundaries:
- Use parameterized queries or prepared statements with bound parameters for all database interactions, especially where
classIdand similar inputs are involved. - Enforce strict server-side validation and type checking for identifiers, ensuring values such as
classIdconform to expected formats (e.g., integers or known IDs) before they are used in queries. - Apply least-privilege principles to the database account used by the web application so it only has the minimum necessary permissions (e.g., read-only where feasible).
- Centralize data access in a data access layer or ORM that defaults to safe query construction patterns.
- Implement a secure coding standard that prohibits ad-hoc string-based SQL assembly with user input.
How teams detect issues like this
Detection efforts can combine automated analysis with focused review of database access code:
- Use static analysis tools configured with rules for identifying SQL injection patterns, such as direct concatenation of
$_GET,$_POST, or other superglobals into SQL strings. - Perform manual code review of
instructorClasses.phpand related modules, looking for raw SQL queries that incorporate user input without parameterization. - Introduce pre-commit or CI policies that flag direct usage of user-controlled variables inside SQL strings and require the use of prepared statements or query builders.
- Conduct application-level security testing, including parameter fuzzing and error-based checks on
classId, to detect unexpected database errors or behavior indicative of injection.

