Summary
A critical SQL injection flaw in the scheduleSubList.php endpoint of the Online Student Enrollment System v1.0 allows untrusted user input from the subjcode parameter to be directly concatenated into SQL queries.
When an attacker can control this parameter, they may be able to manipulate the underlying database queries, leading to data exfiltration, modification, or full compromise of the application's data layer.
Affected context
This vulnerability affects deployments of the Online Student Enrollment System v1.0 where the scheduleSubList.php script is exposed to users (e.g., students, staff, or public users) and passes the subjcode request parameter directly into SQL statements.
The risk is heightened in environments where the application uses a privileged database account, lacks query-level access controls, or is reachable from untrusted networks such as the public internet.
Exploit preconditions
- Attack surface: HTTP requests to
scheduleSubList.phpthat accept asubjcodeparameter via GET or POST. - Required access: Ability to send web requests to the affected endpoint; this may be anonymous or authenticated depending on deployment.
- Trigger point: The application constructs an SQL query by interpolating the
subjcodeparameter into the query string and submits it to the database. - Why exploitation is possible: The
subjcodeparameter is neither validated nor parameterized, allowing attacker-controlled input to alter the structure of the SQL query rather than being treated as a data value.
Why this happens
The root cause aligns with CWE-89: SQL Injection, where dynamic SQL statements are built by concatenating untrusted input directly into query strings.
In this case, the scheduleSubList.php script interpolates the subjcode parameter into SQL without using prepared statements, bound parameters, or robust input validation.
This insecure pattern allows user input to break out of the intended data context and inject additional SQL tokens, conditions, or statements that the database will execute.
Potential impact
- Database query manipulation that can modify or bypass application logic.
- Unauthorized reading of student records, enrollment data, and other sensitive information.
- Unauthorized modification or deletion of enrollment schedules and related records.
- Escalation of application privileges by tampering with user or role data stored in the database.
- In some environments, potential execution of database-level commands that could impact the host or adjacent systems, depending on DBMS configuration.
General mitigation guidance
Effective mitigation centers on treating all external input as untrusted and strictly separating data from code in database operations.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database access, ensuring user-controlled values are bound as parameters rather than concatenated into SQL strings.
- Applying strict input validation and normalization for identifiers like
subjcode, such as whitelisting allowed formats (e.g., specific patterns of letters and digits) before using them in queries. - Implementing least-privilege database accounts so the application can only perform the minimal set of operations required (e.g., read-only where feasible).
- Centralizing database access logic in a data access layer that enforces safe query construction patterns by default.
- Employing application-level error handling to avoid leaking database error details that aid in crafting injections.
How teams detect issues like this
Organizations can detect and monitor for SQL injection risks through a combination of code-centric and operational approaches:
- Static analysis: Configure SAST rules to flag direct string concatenation into SQL statements and highlight uses of raw query execution APIs that accept interpolated strings.
- Code review: During manual review, look for patterns where request parameters (like
$_GET['subjcode']or$_POST['subjcode']) are used directly in queries without parameter binding or validation. - Runtime protections: Use web application firewalls (WAFs) or similar proxies configured with SQL injection detection signatures to observe and, where appropriate, block suspicious payloads.
- Security testing: Incorporate automated DAST tools and targeted penetration tests against endpoints such as
scheduleSubList.phpto identify injectable parameters and verify mitigation effectiveness.

