Summary
A SQL injection vulnerability in SourceCodester Online Reviewer Management System 1.0 allows remotely supplied input in the assessment subject removal function to influence database queries.
An attacker who can reach the affected endpoint may manipulate the ID argument to access, alter, or disrupt database records, depending on database permissions and application behavior.
Affected context
The vulnerability occurs in the remotely accessible assessment subject removal endpoint at /reviewer_0/admins/assessments/subject/btn_functions.php?action=remove. It becomes risky when the endpoint incorporates the supplied ID argument into a database query without consistently applying parameterization, validation, or equivalent query-safety controls.
Exploit preconditions
- Attack surface: Remotely accessible web application endpoint
- Required access: Network reachability to the affected function; authentication requirements depend on deployment configuration
- Trigger point: Processing of the
IDargument for the assessment subject removal action - Why exploitation is possible: Attacker-controlled input may influence SQL statement structure when query construction does not safely separate data from executable SQL
Why this happens
The underlying bug is an injection flaw in database query construction. User-controlled input is apparently accepted by the assessment subject removal function and used in a database operation without sufficient separation between query code and data.
This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) and is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because untrusted input may be interpreted by a downstream SQL processor.
Potential impact
- An attacker may read unauthorized database records
- An attacker could modify or delete application data
- The application may experience integrity loss or service disruption
- Exposed database contents may include reviewer, subject, or administrative information
- Broader compromise may be possible if the database account has excessive privileges
General mitigation guidance
Mitigation generally focuses on ensuring that all database operations use parameterized queries or safely bound query interfaces rather than string concatenation.
Common defensive patterns include:
- Validate identifiers against expected types, ranges, and authorization rules
- Use prepared statements or equivalent database abstraction controls
- Apply allowlist validation to action parameters
- Enforce authorization checks before destructive operations
- Run the application with a database account limited to required tables and operations
- Avoid exposing detailed database errors to remote users
- Treat client-supplied identifiers as untrusted even when they appear numeric
How teams detect issues like this
Detection approaches may include:
- Static analysis rules for SQL construction involving request parameters
- Code review checks for string concatenation or interpolation inside database queries
- Testing that verifies prepared statements and parameter binding are used consistently
- Web application monitoring for malformed or unusually structured request parameters
- Database audit logging for unexpected query patterns, bulk reads, or unauthorized modifications
- Policy enforcement requiring approved data-access libraries and input-validation controls
Neutral automated security and code-review tools can help identify injection-prone query patterns during development.

