Summary
Online FIR System 1.0 contains a SQL injection vulnerability in the login functionality (/Login/checklogin.php), where the email and password parameters are unsafely embedded into database queries.
An attacker can remotely manipulate these inputs to alter the SQL logic, potentially bypassing authentication and accessing or modifying backend data.
Affected context
The vulnerability occurs in the login component of Online FIR System 1.0, specifically within /Login/checklogin.php, when processing user-supplied email and password fields.
It is most relevant in deployments where user input is directly concatenated into SQL queries without parameterization or robust validation, and where the database account used by the application has broad read or write permissions on sensitive tables.
Exploit preconditions
- Attack surface: Public-facing web login endpoint at
/Login/checklogin.php. - Required access: Network reachability to the web application; no prior authentication required.
- User-controllable input: The
emailandpasswordparameters in the login form or equivalent HTTP requests. - Trigger point: Server-side execution of an SQL query that incorporates these parameters without proper escaping or parameter binding.
- Why exploitation is possible: The application interpolates raw input into SQL statements, allowing crafted values to break out of intended query structure and inject additional SQL clauses or conditions.
Why this happens
This issue stems from constructing SQL statements by concatenating or interpolating raw user input into query strings without using prepared statements or safe parameter binding.
This pattern maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') and is related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.
Because the login code trusts email and password values to be benign, it fails to neutralize metacharacters such as quotes and logical operators, enabling attackers to change the query's logic at runtime.
Potential impact
- Attacker may bypass authentication and gain access to accounts without valid credentials.
- Attacker could read sensitive records stored in the database, such as user details or complaint information, depending on database privileges.
- Attacker may modify, insert, or delete records, potentially tampering with or erasing FIR data.
- Attacker could enumerate database structure and metadata to facilitate broader compromise.
- In some configurations, attacker might leverage SQL injection to execute additional database functions that could impact server integrity.
General mitigation guidance
Effective mitigation centers on eliminating direct use of user input in SQL query construction and reducing the trust boundary around authentication data.
Recommended defensive patterns include:
- Using parameterized queries or prepared statements for all database access in the login component and elsewhere.
- Implementing a robust data access layer that encapsulates query construction and disallows raw string concatenation.
- Applying strict server-side validation and normalization for authentication fields (e.g., ensuring
emailconforms to expected format and limiting length). - Using least-privilege database accounts so that even if a query is manipulated, accessible data and operations are minimized.
- Centralizing secure coding guidelines and patterns for database interaction to ensure consistent defenses across the application.
How teams detect issues like this
Organizations can identify this class of issue using a combination of code-centric and behavior-centric approaches:
- Static code analysis: Scan PHP code for SQL query construction that uses string concatenation, interpolation, or unvalidated
$_POST/$_GETvariables, especially in authentication routines. - Code review: Manually inspect
/Login/checklogin.phpand related data access layers for direct insertion ofemailandpasswordinto SQL, absence of prepared statements, and missing validation. - Dynamic testing: Use web application scanners or security testing tools configured to send payloads in login fields and monitor for SQL error messages, anomalies in responses, or authentication bypass.
- Policy enforcement: Establish CI/CD checks and secure coding standards that forbid non-parameterized SQL and require use of approved database access abstractions.

