Summary
A SQL injection vulnerability in the Class and Exam Timetabling System allows remote input supplied through the fname argument to influence a database query.
When the affected administrative endpoint processes crafted input without adequate separation from SQL syntax, an attacker may read, alter, or otherwise interact with application data.
Affected context
The vulnerability occurs in Class and Exam Timetabling System 1.0, specifically in /admin/modal_add_product.php, where the fname argument is used in a query executed through mysqli_query. Risk depends on whether the endpoint is reachable by an attacker and whether request data reaches the database operation without effective parameterization or validation.
Exploit preconditions
- Attack surface: The remotely accessible
/admin/modal_add_product.phpendpoint - Required access: Network access to the endpoint; authentication requirements depend on the application's administrative access controls
- Trigger point: Processing the
fnamerequest argument during product-related database operations - Why exploitation is possible: User-controlled input can affect SQL statement structure when it is incorporated into a query without a safe parameter-binding boundary
Why this happens
The underlying bug is an injection flaw in database query construction. Input from the fname argument is passed into a mysqli_query operation in a manner that may allow data to be interpreted as SQL syntax rather than only as a value.
This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). CWE-74 is a broader injection classification covering cases where externally controlled data changes the meaning of an interpreted command or query.
Potential impact
An attacker may retrieve unauthorized application or database records.; An attacker could modify, insert, or delete database information.; An attacker may bypass intended application data-handling controls.; Database availability or application integrity could be affected.
General mitigation guidance
Mitigation generally focuses on ensuring that external input is never treated as SQL syntax.
Common defensive patterns include:
- Using parameterized queries or prepared statements for every database operation
- Applying allowlist-based validation appropriate to the expected
fnamedata type and format - Keeping validation separate from, rather than substituting for, query parameterization
- Limiting the database account to only the permissions required by the application
- Avoiding dynamic SQL construction when a fixed query or data-access abstraction is sufficient
- Restricting administrative endpoints through authentication, authorization, and network policy
- Handling database errors without exposing query details to users
How teams detect issues like this
Detection approaches commonly include:
- Static analysis rules that identify string concatenation or interpolation inside
mysqli_querycalls - Code review checks for request parameters flowing into SQL APIs without bound parameters
- Dynamic application testing that examines database-backed endpoints for unexpected query behavior
- Runtime monitoring for anomalous query errors, unusual administrative requests, and abnormal data-access patterns
- Policy enforcement requiring prepared statements or approved database-access abstractions
- Neutral automated review tools that trace user-controlled data into database execution functions

