Summary
A SQL injection vulnerability in the Class and Exam Timetabling System allows attacker-controlled input in the course parameter to influence a database query.
Because the affected endpoint is remotely reachable, an unauthenticated or otherwise authorized attacker may be able to read, alter, or interfere with application data, depending on database permissions and deployment controls.
Affected context
The vulnerability occurs in the administrative course-management functionality at /admin/modal_add_course.php, where the course argument is incorporated into a query executed through mysqli_query. Risk is present when the endpoint is accessible over the network and user-controlled input reaches the database layer without effective parameterization or equivalent query separation.
Exploit preconditions
- Attack surface: The remotely accessible administrative course-management endpoint
- Required access: Network access to the application; authentication requirements depend on deployment and endpoint access controls
- Trigger point: Processing the
courseargument in/admin/modal_add_course.php - Why exploitation is possible: Input is apparently incorporated into a database query in a way that may allow query structure to be altered
Why this happens
The underlying bug is the unsafe construction or execution of a database query using externally influenced input. When application data is combined with SQL syntax instead of being passed through a parameterized interface, specially crafted input may change the meaning of the query.
This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). CWE-74 is a broader related classification covering improper neutralization of special elements in an output or command context.
Potential impact
- An attacker may read sensitive records from the application database
- An attacker could modify or delete timetable, course, or account data
- Database integrity and application availability may be affected
- Exposed credentials or configuration data could enable further compromise
- The broader application environment may be impacted if database privileges are excessive
General mitigation guidance
Mitigation generally focuses on separating SQL code from user-controlled values and reducing the trust placed in request parameters.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database operations
- Applying allowlisted validation for course identifiers and other expected input formats
- Avoiding dynamic SQL construction when a fixed query structure is sufficient
- Restricting database accounts to the minimum permissions required by the application
- Centralizing database access through reviewed data-access components
- Treating client-side validation as supplementary rather than a security boundary
- Limiting administrative endpoint exposure and enforcing appropriate authentication and authorization
How teams detect issues like this
Detection approaches can include:
- Static analysis rules that identify string concatenation or interpolation in SQL execution calls
- Code review checks for request parameters passed directly to
mysqli_queryor similar database APIs - Dynamic application testing using benign input variations to identify unexpected query behavior
- Database monitoring for anomalous statements, access patterns, or privilege use
- Policy enforcement requiring prepared statements and reviewed data-access abstractions
- Neutral automated code-review tools that flag unsanitized data flows into database query functions

