Severity:

HIGH RISK

(7.3)

SQL Injection in Online Reviewer System exam-delete.php

CVE-2026-2197

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Data Access and Manipulation

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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_id parameter (this may be via authenticated admin panels or any exposed endpoint that routes to this functionality).
  • Trigger point: Server-side handling of the test_id argument 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_id is 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_id used in CRUD operations.

Automated review tools can help enforce safe query-building patterns and prevent regressions.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/tiancesec/CVE/issues/18
vuldb.comvuldb.com/?ctiid.344900
vuldb.comvuldb.com/?id.344900
vuldb.comvuldb.com/?submit.750012

Frequently asked

questions

Yes. As long as the Online Reviewer System is reachable over the network and the vulnerable endpoint can be invoked, an attacker can attempt exploitation remotely by sending crafted HTTP requests.

It depends on how the exam deletion functionality is exposed. If /system/system/admins/assessments/pretest/exam-delete.php is only accessible after authentication, the attacker must first obtain or bypass valid credentials. If misconfigured access controls expose it more broadly, exploitation could be possible without authentication.

Refactor the affected code to use prepared statements or parameterized queries for all interactions with the database, strictly binding test_id as a parameter and enforcing type validation before it reaches the database layer.

Adopt a secure coding standard that mandates parameterized queries, centralize data access layers, and use automated checks (static analysis, code review templates) to flag any dynamic query construction from raw input. Combine this with least-privilege database accounts and routine security testing focused on injection vectors.

Find out what's already
exploitable in your codebase.