Severity:

HIGH RISK

(7.3)

SQL Injection in Login Component of Online Reviewer System

CVE-2026-2166

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

Online Reviewer System 1.0 contains a SQL injection vulnerability in the login component (/login/index.php) where the username and password parameters are not safely handled before being used in database queries.

A remote attacker can manipulate these inputs to interfere with SQL query logic, potentially bypassing authentication and accessing or modifying backend data.

Affected context

This vulnerability appears in the login workflow of the Online Reviewer System 1.0 web application, specifically within /login/index.php.

It manifests when user-supplied username and password values are used to build SQL queries without proper parameterization or escaping.

The issue is most relevant on deployments where the application is internet-accessible and the database account used by the login script has broad privileges over application data.

Exploit preconditions

  • Attack surface: Public-facing web login form at /login/index.php.
  • Required access: Network access to the web application; no prior authentication is needed.
  • Trigger point: Submission of crafted username and/or password values through the login request (form or HTTP client).
  • Why exploitation is possible: The login logic appears to concatenate raw input directly into SQL statements, allowing attacker-controlled fragments to alter query structure instead of being treated purely as data.

Why this happens

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

The login script likely builds SQL queries using string concatenation or interpolation with untrusted username and password parameters, without using prepared statements or robust input binding.

This insecure pattern allows control characters and SQL syntax from user input (e.g., quotes, comment markers, operators) to break out of intended query boundaries and modify the logic executed by the database.

The mention of CWE-74 (Improper Neutralization of Special Elements in Output) reflects a broader failure to neutralize special characters but the primary manifestation is classic SQL injection in the authentication flow.

Potential impact

  • Bypass of authentication controls and unauthorized access to user or administrator accounts.
  • Exposure of sensitive information stored in the database, including user details and review content.
  • Modification or deletion of application data, impacting integrity of reviews and user records.
  • Potential creation of new privileged accounts within the application.
  • In some environments, possible leverage toward further database or server compromise depending on database configuration and features enabled.

General mitigation guidance

Mitigation should focus on eliminating dynamic SQL construction and reducing trust in user-provided credentials:

  • Use parameterized queries or prepared statements for all database interactions in the login component, binding username and password as parameters instead of concatenating them into query strings.
  • Centralize database access through a data access layer that enforces parameterization by default and discourages ad-hoc query construction.
  • Apply strict input handling for authentication fields (e.g., expected character sets and lengths), while recognizing that validation is a complement to, not a replacement for, safe query APIs.
  • Ensure the database account used by the login script follows least-privilege principles, granting only the minimal permissions necessary for authentication checks.
  • Consider security-focused coding guidelines and secure-by-default framework configurations that make unsafe query patterns harder to implement.

How teams detect issues like this

Organizations can identify this class of issue with a combination of analysis and testing:

  • Static analysis: Enable rules that flag dynamic SQL creation using string concatenation or interpolation, especially in authentication-related code paths like /login/index.php.
  • Code review: Look for direct inclusion of $_POST, $_GET, or other user input variables in SQL strings; verify that prepared statements with bound parameters are used consistently.
  • Dynamic testing: Use application security testing tools or manual penetration testing to send crafted login inputs and observe abnormal SQL error messages or authentication bypass behavior.
  • Policy enforcement: Adopt development standards that mandate parameterized queries and integrate automated checks in CI pipelines to block new insecure query patterns.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/liaoliao-hla/cve/issues/2
vuldb.comvuldb.com/?ctiid.344868
vuldb.comvuldb.com/?id.344868
vuldb.comvuldb.com/?submit.750018
vuldb.comvuldb.com/?submit.751858

Frequently asked

questions

Yes. An attacker with network access to the web application can exploit the issue by sending malicious input to the login endpoint, without needing an existing account.

No. The vulnerable parameters (username and password) are part of the public login process, so exploitation can occur before any authentication takes place.

Refactor the login logic to use parameterized queries or prepared statements for all database calls and remove any string-concatenated SQL involving user-controlled data. Combine this with least-privilege database credentials.

Standardize on secure database access patterns (prepared statements only), enforce them via code reviews and automated checks, and provide developers with secure coding guidelines that explicitly prohibit dynamic SQL construction with raw user input.

Find out what's already
exploitable in your codebase.