/

CVE-2026-10227

Severity:

HIGH RISK

(7.3)

SQL Injection in User Creation Handler of PHP Student

CVE-2026-10227

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Database Compromise and Authentication Bypass

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 PHP-based student_management_system_by_php project contains a SQL injection vulnerability in the User Creation Handler (add_user_check.php) via the role parameter.

An attacker who can send crafted requests to the user creation endpoint may be able to execute arbitrary SQL queries, potentially exposing or modifying application data remotely.

Affected context

This issue affects deployments of the raisulislamg4 student_management_system_by_php project that expose the User Creation Handler (add_user_check.php) over a network-accessible interface.

The vulnerability is present when the role parameter from incoming requests is used in SQL statements without adequate neutralization or parameterization.

Any environment where the application connects to a relational database (such as MySQL) with an account that has broad privileges is at higher risk of data exposure or modification.

Exploit preconditions

  • Attack surface: HTTP request to the user creation functionality, typically via add_user_check.php.
  • Required access: Network access to the application; exploitation may occur with low or no prior authentication if user creation is not strictly restricted.
  • Trigger point: Submission of a crafted role parameter value that is incorporated into a dynamic SQL query.
  • Why exploitation is possible: The application constructs SQL statements from user-controlled input without using parameterized queries or sufficient escaping, allowing attacker-controlled SQL fragments to be executed by the database engine.

Why this happens

The root cause is unsafe construction of SQL queries using user input, specifically the role parameter, within the User Creation Handler.

Instead of relying on parameterized statements or a query builder, the handler appears to concatenate raw input into SQL strings, which maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Because this input is not consistently validated or constrained to an expected set of roles, the database interpreter receives queries that include attacker-supplied control characters and clauses, enabling unintended query execution.

Potential impact

  • Extraction of sensitive information from user and student records, including personal data.
  • Modification or deletion of user accounts, student records, or other critical tables.
  • Creation of new administrative or privileged accounts, leading to full application takeover.
  • Bypassing authentication or authorization checks by tampering with role-related logic in queries.
  • Potential escalation to remote code execution on the server if the database or application environment is misconfigured to allow such actions.

General mitigation guidance

Effective mitigation focuses on treating all role values as untrusted and removing direct string concatenation from database interactions:

  • Use parameterized (prepared) statements or an ORM/query builder that automatically binds variables rather than interpolating them into SQL strings.
  • Constrain the role field to a fixed set of server-side enumerated values (e.g., using whitelists or mapping identifiers to constants) rather than trusting client-provided role names.
  • Apply strict input validation on all parameters involved in SQL queries, rejecting unexpected formats instead of attempting to sanitize arbitrary strings.
  • Reduce database account privileges to the minimum required for the application so that even if a query is abused, the blast radius is limited.
  • Centralize database access logic to common helper functions or repositories, making it easier to enforce secure query patterns consistently across the codebase.

How teams detect issues like this

Organizations can detect this class of vulnerability with a combination of automated and manual techniques:

  • Static analysis rules that flag dynamic SQL construction, especially concatenation of $_GET/$_POST/$_REQUEST variables directly into query strings in PHP.
  • Code review checklists that require all SQL queries in request handlers (such as add_user_check.php) to use prepared statements and server-side role enumeration.
  • Runtime security testing (SAST/DAST) that sends SQL meta-characters through parameters like role and monitors for error messages, anomalous responses, or timing differences.
  • Central policies or linters that disallow database access outside of vetted data access layers, making ad-hoc query construction more visible.

Sources

SourceLink
github.comgithub.com/raisulislamg4/student_management_system_by_php/
github.comgithub.com/raisulislamg4/student_management_system_by_php/issues/4
vuldb.comvuldb.com/cve/CVE-2026-10227
vuldb.comvuldb.com/submit/822819
vuldb.comvuldb.com/vuln/367506
vuldb.comvuldb.com/vuln/367506/cti

Frequently asked

questions

Exploitability depends on how the user creation endpoint is exposed. If add_user_check.php is reachable over the internet and not strictly limited to administrators, remote attackers can attempt SQL injection directly through the role parameter.

Not necessarily. If the application allows unauthenticated or weakly authenticated access to the user creation functionality, an attacker may exploit it without valid credentials. If access is restricted to authenticated users, exploitation would require at least that level of access.

Refactor the User Creation Handler and related code to use parameterized queries for all database operations and map incoming role values to predefined server-side constants or IDs, rather than trusting client-supplied SQL fragments.

Standardize on a secure data access layer using prepared statements or an ORM, enforce strict input validation and server-side enums for role-like fields, and integrate static analysis and security-focused code reviews into the development pipeline to catch unsafe query patterns early.

Find out what's already
exploitable in your codebase.