Summary
A SQL injection vulnerability in the Online Job Portal allows crafted input to be passed into database queries without proper sanitization in the /Admin/DeleteUser.php endpoint.
When exposed to remote attackers, this flaw can lead to unauthorized data access, manipulation, or deletion of user records, particularly in administrative contexts.
Affected context
The vulnerability occurs in the administrative portion of the Online Job Portal application, specifically in the DeleteUser functionality of /Admin/DeleteUser.php.
It is typically present when user-controlled parameters (such as user IDs or search filters) are concatenated into SQL queries without adequate validation or parameterization.
This risk is highest when the admin interface is accessible over the network and input to deletion operations is not constrained by strict server-side checks.
Exploit preconditions
- Attack surface: HTTP requests against the /Admin/DeleteUser.php endpoint in the web application.
- Required access: Ability to reach the administrative delete-user function; this may be through valid admin credentials, misconfigurations exposing admin interfaces, or session hijacking.
- Trigger point: Submission of specially crafted parameters (e.g., query string or POST body values) that are processed by the delete-user logic and passed into SQL statements.
- Why exploitation is possible: The application builds SQL queries dynamically using untrusted input without robust escaping or prepared statements, enabling the attacker to alter query structure.
Why this happens
The underlying issue is unsafe construction of SQL commands using directly concatenated user input, a classic manifestation of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Instead of treating input as data, the application lets attacker-controlled values modify the logic of the query during the DeleteUser operation.
This pattern often emerges from mixing presentation logic and data access code, omitting parameterized queries and centralized input validation, and trusting client-side constraints.
Potential impact
- Attackers may read sensitive user information from the job portal database.
- Attackers could modify or delete user accounts, potentially locking out legitimate users.
- Attackers can manipulate application state, such as elevating privileges or creating rogue admin accounts.
- Attackers may cause data integrity issues, including corruption of job listings or candidate records.
- In some configurations, attackers might execute additional SQL commands that affect other tables or schemas.
General mitigation guidance
Effective mitigation centers on treating all user-supplied data as untrusted and isolating it from SQL command structure.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database interactions, especially in admin features.
- Implementing strict server-side validation and normalization of identifiers (e.g., numeric user IDs) before using them in queries.
- Centralizing database access in well-reviewed data access layers rather than embedding SQL in page controllers.
- Applying least-privilege to database accounts so that even if a query is abused, the scope of accessible data and operations is minimized.
- Avoiding dynamic query generation based on raw request parameters; where dynamic behavior is needed, constrain it to a safe, enumerated set of values.
How teams detect issues like this
Detection typically relies on a mix of code-level and behavioral analysis:
- Static analysis rules that flag direct concatenation of $_GET, $_POST, or other request parameters into SQL strings.
- Code review checklists emphasizing the use of prepared statements and prohibiting raw query construction in admin endpoints like DeleteUser.
- Runtime monitoring and logging for anomalous query patterns, such as unexpected use of logical operators or comment markers in input fields.
- Web application firewalls configured with SQL injection signatures that can surface suspicious requests hitting /Admin/DeleteUser.php.
- Automated security testing (DAST/SAST) integrated into CI pipelines to regularly scan for injection vectors in new or modified PHP code.

