/

CVE-2026-10186

Severity:

HIGH RISK

(7.3)

SQL Injection in Online Hospital Management System

CVE-2026-10186

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Database Access and Data Manipulation

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

Online Hospital Management System 1.0 contains a SQL injection vulnerability in the /patient.php endpoint via the editid parameter.

When user-controlled input is embedded into SQL queries without proper sanitization or parameterization, a remote attacker can manipulate database queries, potentially exposing or altering sensitive medical data.

Affected context

The vulnerability occurs in the web-facing patient management functionality of the Online Hospital Management System 1.0, specifically in /patient.php where the editid argument is processed.

It is typically exposed when the application directly concatenates request parameters into SQL statements for retrieving or updating patient records.

This tends to manifest in deployments where input validation, output encoding, or parameterized queries are incomplete or inconsistently applied in legacy PHP/MySQL-style code.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Online Hospital Management System, specifically requests to /patient.php.
  • Required access: Network access to the web application; depending on deployment, the attacker may need to be an authenticated user if /patient.php is not publicly reachable.
  • Trigger point: Supplying crafted values in the editid parameter (e.g., query string or POST body) that are interpreted as part of an SQL statement.
  • Why exploitation is possible: The application likely interpolates the editid value directly into SQL without using prepared statements or proper escaping, allowing the attacker's input to alter the structure of the query rather than being treated as data.

Why this happens

This issue stems from constructing SQL queries by concatenating raw user input into query strings within server-side code.

Instead of using parameterized statements, the /patient.php implementation appears to trust the editid parameter and embed it directly into SQL clauses, which corresponds to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The mention of CWE-74 also reflects insufficient neutralization of special elements in output contexts, but the primary bug class is treating untrusted data as executable SQL logic.

Potential impact

  • The attacker may read sensitive patient or hospital records that would normally require higher privileges.
  • The attacker could modify, insert, or delete patient data, impacting data integrity and clinical workflows.
  • The attacker might escalate privileges by manipulating user or role tables, if accessible.
  • The attacker could potentially execute database-specific functions that impact availability, such as causing application errors or locking tables.
  • In some environments, the attacker might pivot to underlying system access if unsafe database features or stored procedures are exposed.

General mitigation guidance

Effective mitigation focuses on isolating untrusted input from query execution and reducing trust in user-controlled fields:

  • Use parameterized queries or prepared statements for all database interactions involving user input, including IDs such as editid.
  • Apply strict server-side validation and type enforcement (e.g., ensuring editid is an integer within expected bounds) before using it in any database context.
  • Centralize database access through a data access layer that enforces safe query construction patterns by default.
  • Implement least-privilege access for the application's database account so that, even if a query is abused, the account cannot perform unnecessary operations.
  • Avoid building dynamic SQL with concatenated strings; where dynamic behavior is unavoidable, restrict allowed values (e.g., via whitelists) and keep them separate from data parameters.

How teams detect issues like this

Organizations can detect this class of vulnerability through several complementary approaches:

  • Static application security testing (SAST) rules that flag string concatenation into SQL query builders, especially where HTTP parameters like editid flow directly into queries.
  • Manual code review focused on database access layers and legacy PHP patterns (e.g., direct mysqli_* or PDO->query() calls with interpolated variables).
  • Runtime application security testing (DAST) that sends crafted payloads in parameters such as editid and monitors for SQL error messages or anomalous responses.
  • Database-side monitoring for unusual or malformed queries originating from the application, including tautologies or UNION-based query patterns.
  • CI/CD policy checks that prevent merging code containing non-parameterized SQL where user input is present.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/aiyuyuyu/cve/blob/main/patient_sql.md
vuldb.comvuldb.com/cve/CVE-2026-10186
vuldb.comvuldb.com/submit/819933
vuldb.comvuldb.com/vuln/367467
vuldb.comvuldb.com/vuln/367467/cti

Frequently asked

questions

Yes. The vulnerability is reachable over the network through the web interface, and an attacker can exploit it by sending crafted requests to /patient.php, subject to any authentication requirements in front of that endpoint.

It depends on how the hospital management system is deployed and configured. If /patient.php is protected behind a login, the attacker would need at least low-privileged access; if it is exposed publicly or via weak access controls, unauthenticated exploitation may be possible.

The most robust fix is to refactor the affected code to use parameterized queries or prepared statements everywhere, combined with strict input validation (e.g., numeric validation for identifiers like editid) and removal of any direct string concatenation into SQL.

Adopt secure coding standards that mandate parameterized queries, enforce them via code review and automated static analysis, validate and normalize all user inputs before use, and apply least-privilege principles to the database so that even if a flaw slips through, its impact is constrained.

Find out what's already
exploitable in your codebase.