Summary
The Online Reviewer System 1.0 contains a SQL injection vulnerability in the exam deletion functionality, where the test_id parameter is used unsafely in database queries.
A remote attacker can manipulate this parameter to alter backend SQL statements, which may lead to unauthorized data access, modification, or deletion of assessment records.
Affected context
The vulnerability exists in the Online Reviewer System 1.0 within the admin assessment pretest deletion feature, specifically in /system/system/admins/assessments/pretest/exam-delete.php.
It is triggered when the test_id parameter from an HTTP request is processed by server-side code and incorporated into SQL queries without robust input validation or parameterization.
The issue is most relevant in deployments where the application is exposed over a network and where database accounts used by the application have broad privileges over exam or related tables.
Exploit preconditions
- Attack surface: HTTP interface to the Online Reviewer System, reaching
/system/system/admins/assessments/pretest/exam-delete.php. - Required access: Ability to send crafted requests that include a
test_idparameter (this may be via authenticated admin panels or any exposed endpoint that routes to this functionality). - Trigger point: Server-side handling of the
test_idargument inside SQL queries associated with exam deletion. - Why exploitation is possible: User-supplied data is concatenated directly or indirectly into SQL statements without proper parameterization, escaping, or type enforcement, allowing the attacker to modify the structure of the query.
Why this happens
This vulnerability stems from constructing SQL queries using dynamically concatenated strings derived from user input, rather than using prepared statements or strict parameter binding.
The test_id parameter, originating from HTTP request data, is treated as trusted and passed into a query context without adequate validation or encoding.
This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') and is sometimes accompanied by CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, as the untrusted data flows from the web layer into the database layer as executable query syntax.
At an abstract level, any time untrusted input is embedded into an interpreter command (SQL, shell, LDAP) without separating data from code, injection vulnerabilities can arise.
Potential impact
- Unauthorized viewing of assessment or exam-related data that should be restricted.
- Modification or deletion of exam records, test metadata, or associated user responses.
- Bypassing of logical access controls enforced at the application layer by manipulating queries.
- Potential extraction of other database contents if the same connection has broader privileges.
- In certain configurations, use of database-specific features to escalate impact (e.g., writing to server files or chaining with other weaknesses).
General mitigation guidance
Effective mitigation focuses on enforcing a strict separation between SQL code and user-supplied data, and on reducing trust in incoming parameters:
- Use parameterized queries or prepared statements for all SQL operations involving external input, ensuring that
test_idis always bound as a typed parameter. - Apply strong server-side validation and normalization for identifier-like fields such as
test_id(e.g., enforcing numeric types and expected ranges). - Centralize database access logic so that query-building patterns are consistent and easier to audit.
- Limit the database account privileges used by the application to only those operations necessary for the exam management features.
- Employ a defensive coding standard that prohibits dynamic SQL construction from raw request parameters unless additional safe-building mechanisms are used.
These patterns reduce the risk of injection not only for this endpoint but across the entire application.
How teams detect issues like this
Detection can be approached from both code and runtime perspectives:
- Static analysis: Configure scanners or linters with rules that flag direct string concatenation in SQL query construction, especially where inputs like
$_GET,$_POST, or request parameters flow into SQL execution APIs. - Code review: During manual review, look for database calls that embed variables directly into SQL strings, and verify that all database interactions use prepared statements and input validation helpers.
- Runtime monitoring: Use database activity monitoring (DAM) or application logs to identify anomalous query patterns, such as unexpected operators, comment sequences, or multiple statements where only one is expected.
- Security testing: Incorporate automated and manual SQL injection testing in CI/CD pipelines and periodic penetration tests, focusing on parameters like
test_idused in CRUD operations.
Automated review tools can help enforce safe query-building patterns and prevent regressions.

