Summary
A SQL injection vulnerability in the Online-Examination-System registration form allows remote attackers to influence database queries through the branch argument.
Under conditions where the input reaches MySQLDB::addNewUser without adequate parameterization, an attacker may read, alter, or otherwise interfere with database operations.
A SQL injection vulnerability in the Online-Examination-System registration form allows remote attackers to influence database queries through the branch argument.
Under conditions where the input reaches MySQLDB::addNewUser without adequate parameterization, an attacker may read, alter, or otherwise interfere with database operations.
Affected context
The vulnerability occurs in the Registration Form component, specifically in the MySQLDB::addNewUser function within include/database.php. It affects deployments where the branch form value is incorporated into SQL processing without sufficient separation between user-supplied data and query structure. The issue is potentially reachable remotely through the application's registration workflow.
The vulnerability occurs in the Registration Form component, specifically in the MySQLDB::addNewUser function within include/database.php. It affects deployments where the branch form value is incorporated into SQL processing without sufficient separation between user-supplied data and query structure. The issue is potentially reachable remotely through the application's registration workflow.
Exploit preconditions
- Attack surface: Registration Form exposed through the application
- Required access: Network access to the registration functionality; authentication may not be required
- Trigger point: Processing the
branchargument byMySQLDB::addNewUser - Why exploitation is possible: User-controlled input may influence SQL query construction when parameterized database operations and strict validation are insufficient
- Attack surface: Registration Form exposed through the application
- Required access: Network access to the registration functionality; authentication may not be required
- Trigger point: Processing the
branchargument byMySQLDB::addNewUser - Why exploitation is possible: User-controlled input may influence SQL query construction when parameterized database operations and strict validation are insufficient
Why this happens
The underlying issue is an injection flaw in which externally supplied input is allowed to affect the structure or semantics of a SQL statement. This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). CWE-74 is also relevant because the broader defect involves allowing attacker-controlled data to influence an interpreted command language.
The underlying issue is an injection flaw in which externally supplied input is allowed to affect the structure or semantics of a SQL statement. This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). CWE-74 is also relevant because the broader defect involves allowing attacker-controlled data to influence an interpreted command language.
Potential impact
- An attacker may retrieve data that the application account can access
- Database records may be modified, inserted, or deleted
- Application authentication or authorization data could be exposed or altered
- Database availability may be reduced through resource-intensive queries
- The application's confidentiality and integrity could be compromised
- An attacker may retrieve data that the application account can access
- Database records may be modified, inserted, or deleted
- Application authentication or authorization data could be exposed or altered
- Database availability may be reduced through resource-intensive queries
- The application's confidentiality and integrity could be compromised
General mitigation guidance
Mitigation generally focuses on ensuring that user input is treated strictly as data rather than executable SQL syntax.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database operations
- Applying allowlist validation to fields such as
branchaccording to the expected business values - Avoiding dynamic SQL construction from request parameters
- Restricting the database account to the minimum required privileges
- Separating database error details from responses returned to users
- Enforcing secure-by-default data-access abstractions and centralized query handling
Mitigation generally focuses on ensuring that user input is treated strictly as data rather than executable SQL syntax.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database operations
- Applying allowlist validation to fields such as
branchaccording to the expected business values - Avoiding dynamic SQL construction from request parameters
- Restricting the database account to the minimum required privileges
- Separating database error details from responses returned to users
- Enforcing secure-by-default data-access abstractions and centralized query handling
How teams detect issues like this
Detection approaches may include:
- Static analysis rules that identify string concatenation or interpolation of request parameters in SQL statements
- Code review checks for database calls that do not use prepared statements or parameter binding
- Dynamic testing of registration inputs using controlled SQL injection test cases
- Web application firewall or API policy rules that monitor suspicious database-language patterns
- Database audit logging and alerting for anomalous queries issued by the application account
- Automated security review tools that flag unsafe query construction during development
Detection approaches may include:
- Static analysis rules that identify string concatenation or interpolation of request parameters in SQL statements
- Code review checks for database calls that do not use prepared statements or parameter binding
- Dynamic testing of registration inputs using controlled SQL injection test cases
- Web application firewall or API policy rules that monitor suspicious database-language patterns
- Database audit logging and alerting for anomalous queries issued by the application account
- Automated security review tools that flag unsafe query construction during development
Sources
| Source | Link |
|---|---|
| github. | github.com/ |
| github. | github.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |

