Severity:

HIGH RISK

(7.3)

SQL Injection in code-projects Online Reviewer System

CVE-2026-2223

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Database 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 pretest-taking functionality, where the ID parameter in index.php is incorporated into database queries without proper sanitization.

A remote attacker can manipulate this parameter to alter SQL queries, which may lead to unauthorized data access, modification, or other database-level impacts.

Affected context

This vulnerability occurs in the Online Reviewer System 1.0, specifically within the student assessments pretest module at /system/system/students/assessments/pretest/take/index.php.

It is present when the application accepts an ID parameter from user-controlled input (such as query string or form data) and uses it directly in SQL statements without robust input validation, parameterization, or context-aware escaping.

Deployments that expose this endpoint to untrusted networks, such as the public internet, are more susceptible to exploitation.

Exploit preconditions

  • Attack surface: HTTP request interface to /system/system/students/assessments/pretest/take/index.php
  • Required access: Remote, unauthenticated or low-privileged access to the pretest-taking functionality, depending on how the application is deployed and protected
  • Trigger point: Supplying crafted data via the ID parameter in a web request so that it becomes part of a dynamically constructed SQL query
  • Why exploitation is possible: The application constructs SQL statements by concatenating or interpolating raw ID parameter values into query strings without using prepared statements or adequate context-specific sanitization, enabling attackers to inject additional SQL syntax

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The code that handles the ID parameter appears to directly mix user input into SQL queries, often via string concatenation or unsafe interpolation, without consistently using parameterized queries or rigorous input validation.

Additionally, the broader pattern maps to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, since untrusted input is passed to the database (a downstream interpreter) where SQL meta-characters are not neutralized.

This insecure pattern allows attackers to treat data as part of the SQL command structure rather than as a purely literal value.

Potential impact

  • May allow an attacker to read sensitive information from database tables, including student records and assessment data
  • Could enable modification or deletion of assessment content, questions, or results
  • May allow creation or manipulation of user accounts, potentially escalating privileges within the application
  • Could corrupt grading data, leading to inaccurate scores and academic integrity issues
  • In some configurations, may enable further compromise of the underlying system if the database has extended capabilities or excessive privileges

General mitigation guidance

Effective mitigation centers on treating all user-controlled input as untrusted and strictly separating data from SQL command structure.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations, ensuring that input is bound as data rather than concatenated into SQL strings
  • Applying strict server-side validation on the ID parameter (e.g., ensuring it conforms to expected numeric or UUID formats) and rejecting unexpected patterns
  • Employing context-appropriate escaping at the database driver layer when parameterization is not possible, while recognizing this as secondary to prepared statements
  • Implementing least-privilege database accounts so the application can perform only the minimum operations required (e.g., no unnecessary DROP/ALTER privileges)
  • Centralizing data-access patterns through a well-reviewed data access layer instead of ad-hoc query construction in page controllers
  • Enforcing secure coding guidelines and training for developers on injection-safe patterns

How teams detect issues like this

Detection typically combines code-focused and behavior-focused approaches:

  • Static analysis: Configure SAST tools and linters to flag dynamic SQL construction patterns (string concatenation, interpolation) where user input like $_GET['ID'] or similar constructs flow into query APIs
  • Code review: Look for direct use of request parameters in SQL statements, missing prepared statements, and lack of validation or type-casting for primary key fields
  • Runtime monitoring: Use database activity monitoring to detect anomalous queries (e.g., unexpected OR 1=1 patterns, UNION queries, or schema enumeration) originating from the application
  • Security testing: Incorporate automated and manual injection testing in CI/CD pipelines and during periodic security assessments, focusing on parameters such as ID in dynamic endpoints

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/tiancesec/CVE/issues/24
vuldb.comvuldb.com/?ctiid.344940
vuldb.comvuldb.com/?id.344940
vuldb.comvuldb.com/?submit.750027

Frequently asked

questions

Yes. The vulnerable endpoint is accessible over HTTP, so a remote attacker who can reach /system/system/students/assessments/pretest/take/index.php can attempt to exploit the ID parameter.

Not necessarily. Exploitability depends on whether the pretest-taking functionality requires authentication or is exposed to unauthenticated users. If the endpoint is publicly accessible, an unauthenticated attacker may be able to exploit the flaw.

The most robust fix is to replace all dynamically constructed SQL that uses the ID parameter with parameterized queries or prepared statements, combined with strict server-side validation (e.g., treating ID as a strongly typed value). Avoid concatenating or interpolating raw request data into SQL strings.

Adopt a development standard that mandates prepared statements for all data access, enforce validation for all user inputs, and integrate static analysis and security testing into the development lifecycle to flag injection patterns before deployment. Regular code reviews with an explicit injection checklist also help prevent regressions.

Find out what's already
exploitable in your codebase.