Summary
A SQL injection vulnerability in the School Registration and Fee System allows attacker-controlled input from the selector[] parameter to influence database queries. Because the affected endpoint is remotely reachable, an unauthenticated or otherwise authorized attacker may be able to read, modify, or disrupt application data, depending on database permissions.
Affected context
The vulnerability occurs in the delete_stud.php endpoint of SourceCodester School Registration and Fee System 1.0 when the selector[] request parameter is incorporated into database operations without sufficient separation between data and SQL syntax. Risk depends on whether the endpoint is exposed remotely, whether authentication is enforced, and what privileges the application database account possesses.
Exploit preconditions
- Attack surface: The remotely accessible
/bilal/normal/delete_stud.phpendpoint - Required access: Network access to the application; authentication requirements depend on deployment configuration
- Trigger point: Processing of the
selector[]request parameter - Why exploitation is possible: User-controlled input can reach a database query without reliable parameterization or equivalent query-boundary protection
Why this happens
The underlying bug is an injection flaw in which external input is treated as part of a database command rather than strictly as a value. If the endpoint constructs SQL statements through unsafe string concatenation or insufficient input handling, attacker-supplied content may alter query structure. This behavior maps primarily to CWE-89, SQL Injection, and is broadly related to CWE-74, improper neutralization of special elements in an output used by a downstream interpreter.
Potential impact
- An attacker may read unauthorized student or fee records
- An attacker could alter or delete application data
- Database integrity and service availability may be reduced
- Exposed database credentials or privileges could enable broader compromise
- The vulnerability may support follow-on attacks against connected systems
General mitigation guidance
Mitigation generally focuses on ensuring that database commands cannot be
reinterpreted through user-controlled values.
Common defensive patterns include:
- Use parameterized queries or prepared statements for every database operation
- Treat request parameters as untrusted regardless of the endpoint's apparent purpose
- Validate identifiers against strict type, format, and allowlist rules
- Avoid dynamic SQL construction where a fixed query or safe query builder is sufficient
- Apply least-privilege permissions to the application database account
- Enforce authentication and authorization before destructive operations
- Use secure-by-default database access libraries and centralize query handling
How teams detect issues like this
Detection approaches commonly include:
- Static analysis for string concatenation or interpolation between request parameters and SQL statements
- Code review checks for unparameterized queries in deletion and record-selection handlers
- Dynamic application testing using benign SQL-injection test cases in controlled environments
- Web-application firewall or gateway policies that monitor suspicious database-expression patterns
- Database monitoring for unexpected query shapes, bulk reads, or unusual destructive activity
- Automated security review tools integrated into pull-request and CI workflows

