Severity:

HIGH RISK

(7.3)

SQL Injection in Online Examination System Login Page

CVE-2026-1422

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Authentication Bypass and Data Compromise

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Online Examination System 1.0 contains an SQL injection vulnerability in the login page (/index.php) where the User parameter is incorporated into database queries without proper sanitization.

A remote attacker can manipulate this parameter to alter SQL queries, potentially bypassing authentication, extracting sensitive data, or modifying exam-related records.

Affected context

This vulnerability appears in the login functionality of the Online Examination System 1.0, specifically within /index.php when handling the User input field.

It is relevant in deployments where the application connects to a relational database and constructs SQL statements dynamically using raw request parameters.

The risk is higher when the database account used by the application has broad privileges over user, exam, or grading tables and when no web application firewall or query-level protections are in place.

Exploit preconditions

  • Attack surface: Public-facing login page at /index.php.
  • Required access: Network access to the web application; no prior authentication is required.
  • Trigger point: Submission of a crafted User parameter value during the login process (e.g., via an HTTP POST or GET to /index.php).
  • Why exploitation is possible: The User parameter is inserted into SQL queries without adequate input validation, parameterization, or escaping, allowing attacker-controlled input to influence the query structure.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The login page likely builds SQL statements by concatenating user-provided User values directly into query strings, rather than using prepared statements or bound parameters.

Additionally, the presence of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component indicates that untrusted data is passed into the database layer—a downstream component—without proper neutralization, enabling the input to be interpreted as part of the SQL syntax instead of as data.

This insecure pattern arises when application logic trusts form fields to be well-formed and does not enforce strict validation or use of safe database APIs.

Potential impact

  • Bypass of authentication, allowing unauthorized access to student or administrator accounts.
  • Extraction of sensitive information such as user credentials (if stored insecurely), exam questions, or grades.
  • Modification or deletion of exam records, answers, or user profiles.
  • Creation of new privileged accounts within the application data store.
  • Potential full database compromise if the application's database user has extensive privileges.
  • Use of the compromised application as a pivot point to further attack the underlying infrastructure.

General mitigation guidance

Mitigation focuses on eliminating direct concatenation of user input into SQL queries and tightening trust boundaries around login data.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database interactions involving user input.
  • Implementing strict server-side validation on login fields (e.g., expected character sets and length limits for usernames).
  • Centralizing database access through a data-access layer that enforces safe query construction patterns.
  • Assigning least-privilege roles to the database account used by the application so that, even if a query is manipulated, the scope of damage is reduced.
  • Applying generic input-handling safeguards, such as rejecting unexpected or malformed input, and normalizing data before it reaches the database layer.
  • Considering defense-in-depth controls such as web application firewalls configured with SQL injection rules to help detect and block obvious injection attempts.

How teams detect issues like this

Detection can combine code-level analysis with runtime monitoring:

  • Static analysis: Scan the codebase for dynamic SQL construction that concatenates request parameters (particularly the User parameter) into query strings.
  • Code review signals: Look for login logic in /index.php where user-supplied values are embedded directly into SQL statements without prepared statements or binding.
  • Policy enforcement: Enforce development policies that mandate parameterized queries and forbid raw string concatenation for database access, backed by CI checks.
  • Runtime monitoring: Use database activity monitoring or application logs to detect anomalous query patterns, such as unexpected operators, comment sequences, or always-true conditions originating from login requests.
  • Automated security testing tools (e.g., DAST scanners) can be integrated to probe for SQL injection behaviors on the login endpoint during QA.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/geo-chen/code-projects/blob/main/Online%20Examination%20System%20In%20PHP%20With%20Source%20Code.md#finding-2-sql-injection-on-login-page
vuldb.comvuldb.com/?ctiid.342838
vuldb.comvuldb.com/?id.342838
vuldb.comvuldb.com/?submit.736606

Frequently asked

questions

Because the vulnerable parameter is on the public login page, any remote user with network access to the application can attempt to exploit it, making the exposure potentially broad.

No. The injection occurs in the processing of the User parameter prior to successful authentication, so exploitation does not require an existing account.

Refactor the login code to use parameterized queries or prepared statements for all database interactions, ensuring that user input is treated strictly as data, combined with strong input validation and least-privilege database roles.

Adopt a secure coding standard that mandates parameterized queries, integrate static analysis and security checks into the CI pipeline, train developers on injection-safe patterns, and periodically perform security testing focused on input handling and database access paths.

Find out what's already
exploitable in your codebase.