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
Usernamefield during the login request (e.g., via HTTP POST or GET, depending on implementation). - Why exploitation is possible: The application appears to embed the
Usernamevalue 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.

