Summary
Electronic Judging System 1.0 contains a SQL injection vulnerability in the /admin/delete_judge.php endpoint via the judge_id parameter.
A remote attacker can tamper with this parameter to influence backend SQL queries, potentially leading to data exposure, modification, or deletion within the judging system's database.
Affected context
The vulnerability occurs in the administrative functionality of the Electronic Judging System 1.0, specifically in the /admin/delete_judge.php script.
It manifests when user-supplied input in the judge_id parameter is used to construct SQL statements without adequate validation, sanitization, or parameterization.
This is typically exposed over HTTP(S) and may be reachable wherever the admin panel is accessible, depending on how the application is deployed and access control is configured.
Exploit preconditions
- Attack surface: Web interface endpoint
/admin/delete_judge.php. - Required access: Ability to send HTTP requests to the admin endpoint (this may or may not be gated by authentication, depending on deployment configuration).
- Trigger point: Supplying crafted values in the
judge_idparameter when invoking the delete-judge functionality. - Why exploitation is possible: The application appears to concatenate
judge_iddirectly into SQL queries without proper parameterization or robust input handling, allowing attackers to inject arbitrary SQL fragments.
Why this happens
The underlying issue aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
User-controlled data from the judge_id parameter is incorporated into SQL statements without using prepared statements or safe query-building APIs.
This pattern allows special SQL characters and control tokens to alter the logic of the query.
The reference to CWE-74 further reflects the broader category of improper neutralization of special elements in output, where untrusted input is not constrained or encoded before being embedded into a command or data structure.
Potential impact
- Unauthorized reading of database contents, including judge records and potentially other application data.
- Modification or deletion of judge accounts and related records.
- Bypassing of application-level authorization by manipulating queries.
- Potential creation of arbitrary accounts or elevation of privileges if the database schema allows such operations.
- Disruption of the judging workflow through data corruption or loss.
General mitigation guidance
Effective mitigation focuses on robust input handling and safe database interaction patterns:
- Use parameterized queries or prepared statements for all database operations involving user-supplied input, including
judge_id. - Apply strict server-side validation on identifier parameters, enforcing expected types and ranges (e.g., numeric-only IDs).
- Centralize database access through a data access layer that enforces safe query construction by default.
- Limit database privileges of the application account to the minimum required operations, reducing the blast radius if injection occurs.
- Apply consistent input normalization and avoid directly concatenating request parameters into SQL or other command strings.
How teams detect issues like this
Organizations can identify and monitor for this class of vulnerability using:
- Static analysis rules that flag string concatenation in SQL query construction, especially where request parameters are involved.
- Code review checklists that require verification of prepared statements and validation for all database-bound inputs.
- Web application firewalls (WAFs) configured to detect common SQL injection patterns in parameters like
judge_id. - Dynamic application security testing (DAST) tools that probe form fields and query parameters with injection payloads.
- Logging and anomaly detection on database queries to identify unusual patterns indicative of injection attempts.

