Severity:

HIGH RISK

(7.3)

SQL Injection in code-projects Online Reviewer System Login

CVE-2026-2221

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Authentication Bypass and Data Compromise via SQL Injection

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 suffers from a SQL injection flaw in the login functionality (/login/index.php) via the Username parameter.

A remote attacker can manipulate this input to interfere with database queries, which may allow bypassing authentication, accessing sensitive data, or modifying application state.

Affected context

This vulnerability occurs in the login component of the Online Reviewer System 1.0 when processing the Username parameter in /login/index.php.

It is relevant in deployments where user-supplied credentials are concatenated into SQL queries without robust input handling and where the database account used by the application has access to authentication or user data.

The risk increases when the same database connection is highly privileged or shared across multiple application functions.

Exploit preconditions

  • Attack surface: Public-facing web login endpoint at /login/index.php.
  • Required access: Network access to the application; no prior authentication is necessary.
  • Trigger point: Submission of crafted values in the Username field during the login request (e.g., via HTTP POST or GET, depending on implementation).
  • Why exploitation is possible: The application appears to embed the Username value directly into SQL statements without parameterization or proper escaping, allowing an attacker-controlled payload to alter query structure at runtime.

Why this happens

The underlying issue is the construction of dynamic SQL queries using untrusted user input from the Username field.

Instead of using parameterized queries or a safe query builder, the code likely concatenates the raw username value into the SQL string, enabling attackers to inject additional SQL tokens.

This maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is closely related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because the application output (the SQL query) is consumed by the database, a downstream interpreter.

Potential impact

  • Bypass of authentication and login without valid credentials.
  • Unauthorized access to user accounts, including administrative ones, depending on query logic.
  • Exposure of sensitive data stored in the database (user details, review content, metadata).
  • Modification or deletion of application data, including reviews and user records.
  • Potential execution of database-specific commands that could impact system availability or integrity.
  • Pivoting to other parts of the application that rely on the compromised database.

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input into SQL and tightening trust boundaries with the database:

  • Use parameterized queries or prepared statements for all database access in the login component and throughout the application.
  • Employ a robust database abstraction layer or ORM that discourages raw SQL construction and enforces binding of parameters.
  • Apply least-privilege to the database account used by the application so it only has the minimal permissions required (e.g., no schema modification or superuser capabilities).
  • Introduce centralized input validation for authentication fields, constraining usernames to expected character sets and lengths, while not relying on validation alone as a primary defense.
  • Consider using stored procedures or whitelisted query patterns where appropriate, ensuring that user input is only used as data parameters.
  • Implement secure-by-default coding standards and code review checklists that flag dynamic query construction.

How teams detect issues like this

Detection typically combines code-level analysis with runtime monitoring:

  • Static analysis: Configure SAST tools to detect string concatenation or interpolation used to build SQL queries, especially including authentication parameters like Username.
  • Code review signals: Look for direct usage of $_GET, $_POST, or other raw request variables inside SQL string construction in PHP files (e.g., /login/index.php).
  • Policy enforcement: Adopt coding guidelines that mandate prepared statements and fail pull requests that introduce raw SQL without justification.
  • Runtime monitoring: Enable database logging (e.g., general query logs or audit logs) and monitor for anomalous patterns such as unexpected logical operators (OR 1=1), comment markers, or stacked queries, which may indicate injection attempts.
  • Security testing: Regularly run automated dynamic scanners and focused penetration tests on authentication endpoints to identify SQL injection regressions.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/tiancesec/CVE/issues/22
vuldb.comvuldb.com/?ctiid.344938
vuldb.comvuldb.com/?id.344938
vuldb.comvuldb.com/?submit.750024

Frequently asked

questions

Yes. The flaw is in the publicly reachable login endpoint, so any attacker with network access to the application can attempt to exploit it via crafted requests to /login/index.php.

Typically no. Because the injection point is the Username parameter in the login process, exploitation can occur before any authentication is established.

The most robust fix is to replace any dynamically constructed SQL involving user input with parameterized queries or prepared statements, combined with least-privilege database access and central validation of authentication inputs.

Establish development standards that prohibit concatenating user input into SQL, enforce these standards with code review and static analysis, use frameworks or libraries that encourage safe data access patterns by default, and incorporate regular security testing focused on input handling and authentication flows.

Find out what's already
exploitable in your codebase.