Summary
The Online Reviewer System 1.0 contains a SQL injection flaw in the questions-view.php script that processes the ID parameter for pretest assessments.
By manipulating this parameter over the network, an attacker can inject crafted SQL into backend queries, potentially accessing or altering exam-related data without authorization.
Affected context
This vulnerability occurs in the Online Reviewer System 1.0 within the administrator assessment pretest question viewing functionality (/system/system/admins/assessments/pretest/questions-view.php).
It is relevant when the application directly incorporates incoming request parameters (such as ID) into SQL statements without appropriate validation, escaping, or parameterization.
The issue typically manifests in deployments where the web server can reach the database server and the affected script is accessible over the network.
Exploit preconditions
- Attack surface: HTTP(S) endpoint at
/system/system/admins/assessments/pretest/questions-view.php. - Required access: Network access to the web application; additional authentication may or may not be required depending on deployment configuration.
- Input vector: The
IDparameter supplied in the request (e.g., query string or POST body). - Trigger point: Construction and execution of a database query using the
IDvalue without parameterization or proper filtering. - Why exploitation is possible: The application appears to concatenate the raw
IDvalue into a SQL statement, allowing attacker-controlled characters to alter query structure instead of being treated as data.
Why this happens
The underlying bug stems from unsafe construction of SQL queries using untrusted input, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Instead of using prepared statements or parameterized queries, the code likely interpolates the ID parameter directly into the SQL string, failing to neutralize metacharacters like quotes, operators, and comment delimiters.
This pattern allows an attacker to modify the intended SQL logic, pivoting from simple lookups to arbitrary data extraction or modification.
The involvement of CWE-74 highlights that user-controlled special elements in output (here, the SQL command) are not properly sanitized before being sent to an external interpreter (the database).
Potential impact
- May allow attackers to read sensitive data from assessment and user-related tables.
- Could enable modification or deletion of exam questions, answers, or results.
- Can permit creation or manipulation of administrative or user accounts stored in the database.
- May allow discovery of database structure, including table and column names.
- In some configurations, could lead to execution of database-specific functions that impact system integrity or availability.
General mitigation guidance
Effective mitigation focuses on treating all request parameters as untrusted and eliminating dynamic SQL construction patterns.
Recommended defensive strategies include:
- Adopting parameterized queries or prepared statements for all database interactions, especially where user input influences query criteria.
- Implementing strict server-side validation and type enforcement for identifiers like
ID(e.g., ensuring they are numeric and within expected ranges). - Applying a centralized data access layer that abstracts away raw SQL building and enforces secure query construction by default.
- Restricting database account privileges to the minimum necessary, preventing schema changes or access to unrelated tables even if a query is compromised.
- Employing consistent output encoding and neutralization practices for any data forwarded to external interpreters, not just databases.
How teams detect issues like this
Organizations can detect and monitor for vulnerabilities of this class using a combination of development-time and runtime techniques:
- Static analysis: Configure SAST tools to flag string concatenation used to build SQL statements, especially where variables derived from HTTP request parameters appear.
- Code review: Look for direct usage of
$_GET,$_POST, or equivalent request variables in SQL queries; verify that all queries use parameter binding or ORM query builders. - Security testing: Use dynamic application security testing (DAST) tools or manual penetration testing to probe endpoints with crafted payloads that expose SQL errors or unexpected responses.
- Logging and monitoring: Monitor database logs and application error logs for anomalous query patterns, syntax errors, or repeated queries containing typical injection markers, and enforce alerting policies.

