Summary
A SQL injection flaw in the Electronic Judging System 1.0 allows untrusted input from the num_id parameter in /admin/edit_team.php to be incorporated directly into database queries.
When exposed over a network, a remote attacker can send crafted requests that manipulate these queries, potentially accessing, modifying, or deleting application data.
Affected context
The vulnerability occurs in the administrative functionality of the Electronic Judging System, specifically within /admin/edit_team.php, where the num_id argument is used to drive database operations.
It is present when the application constructs SQL queries using this parameter without adequate input validation or parameterization.
Any deployment that exposes the admin interface over HTTP/S and lacks strict access control or additional input filtering may be at risk.
Exploit preconditions
- Attack surface: Network-accessible HTTP/S endpoint
/admin/edit_team.php - Required access: Ability to send requests with controlled
num_idvalues; in many setups, this may require admin or privileged access but could be exposed more broadly if access controls are weak - Trigger point: Processing of requests where
num_idis interpolated into SQL statements - Why exploitation is possible: The application likely concatenates raw request parameters into SQL queries (CWE-89) and may accept unvalidated or improperly encoded input (CWE-74), allowing an attacker to alter query structure
Why this happens
The root cause is the construction of SQL statements by directly embedding user-supplied data from the num_id parameter into query strings.
Instead of using parameterized queries or prepared statements, the code likely concatenates or formats the parameter into SQL, enabling control characters and SQL syntax to influence the query.
This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is related to CWE-74, where untrusted input is not properly neutralized before being used in a downstream interpreter.
Potential impact
- Unauthorized reading of database records, including sensitive or personal data
- Modification or deletion of team records and related judging data
- Bypassing of application-level authorization checks by altering query conditions
- Potential creation of new administrative or privileged accounts if the schema allows
- Disruption of application functionality through tampering with core data
General mitigation guidance
Effective mitigation focuses on preventing untrusted input from altering SQL query structure.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database operations, especially those involving request parameters like
num_id - Applying strict server-side validation and type enforcement (e.g., ensuring
num_idis an integer and rejecting unexpected formats) - Implementing context-appropriate escaping or encoding for data that must be concatenated, while preferring parameterization wherever possible
- Restricting database accounts to least-privilege, so even if a query is manipulated, the scope of accessible data and operations is reduced
- Isolating administrative interfaces, placing them behind strong authentication and, where feasible, network-level access controls
How teams detect issues like this
Detection can combine code-level review and runtime monitoring:
- Static analysis rules that flag string concatenation or formatting used to build SQL queries from request parameters, especially in admin modules
- Code review checklists that require verification of parameterized queries for all database interactions involving user-controlled inputs
- Database activity monitoring to detect anomalous queries containing unexpected operators, tautologies, or stacked commands originating from web requests
- Web application security testing, including automated scanners configured to probe query parameters like
num_idfor SQL injection behavior

