Summary
A remotely reachable SQL injection vulnerability in SourceCodester Online Reviewer Management System 1.0 allows attacker-controlled input in the courseID argument to influence database queries.
If the affected endpoint is accessible and input is not safely handled, an attacker may be able to read, modify, or interfere with application data.
Affected context
The vulnerability occurs in the assessment-related functionality under /reviewer_0/admins/assessments/course/btn_functions.php. It may affect deployments where the endpoint is exposed to remote users and the courseID parameter reaches database query construction without sufficient parameterization or validation.
Exploit preconditions
- Attack surface: Remotely accessible web application endpoint
- Required access: Access sufficient to reach the affected assessment or course-management function; authentication requirements may depend on deployment configuration
- Trigger point: Processing of the
courseIDargument - Why exploitation is possible: Attacker-controlled input may be incorporated into a SQL statement without being treated strictly as data
Why this happens
The underlying issue is an injection flaw in which externally supplied courseID data can influence SQL query structure. 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. The insecure pattern is constructing or executing database queries with untrusted input instead of using parameterized statements and constrained input handling.
Potential impact
- An attacker may read unauthorized records from the application database.
- An attacker could alter or delete application data, depending on database permissions.
- The vulnerability may enable unauthorized access to reviewer, course, assessment, or administrative information.
- Database availability or application integrity could be affected.
General mitigation guidance
Mitigation generally centers on ensuring that all database operations treat request parameters as data rather than executable query syntax.
Common defensive patterns include:
- Using parameterized queries or prepared statements for every database operation
- Applying allowlist validation and type constraints to identifier fields such as
courseID - Avoiding dynamic SQL construction from request parameters
- Limiting the database account to the minimum required privileges
- Separating administrative endpoints from broader network exposure where practical
- Returning generic database errors and avoiding disclosure of query details
These controls reduce both direct injection risk and the potential impact of a compromised application account.
How teams detect issues like this
Detection approaches can include:
- Static analysis for string concatenation or interpolation of request parameters into SQL statements
- Code review of database calls in
btn_functions.phpand related administrative handlers - Dynamic application testing using benign input-variation checks against the affected parameter
- Web application firewall or API policy rules for suspicious SQL metacharacter and operator patterns
- Monitoring for unusual database errors, query volume, access patterns, or data retrieval from administrative endpoints
Automated security review tools may help identify unsafe query construction, but findings should be validated against the application's actual database access layer.

