/

CVE-2026-10185

Severity:

HIGH RISK

(7.3)

SQL Injection in Users Save Endpoint of Hospital Patient

CVE-2026-10185

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

The Hospitals Patient Records Management System 1.0 contains a SQL injection vulnerability in the /classes/Users.php?f=save endpoint, where the ID parameter is incorporated into database queries without adequate sanitization.

A remote attacker who can send crafted requests to this endpoint may manipulate SQL statements, potentially accessing, modifying, or deleting patient and user-related data.

Affected context

This vulnerability appears in the user management logic of the Hospitals Patient Records Management System, specifically in the save functionality exposed at /classes/Users.php?f=save.

It typically manifests when request parameters, such as ID, are passed directly into SQL queries on a relational database without using parameterized statements or robust input validation.

The issue is relevant in deployments where this PHP endpoint is reachable over a network and database credentials allow read or write operations on patient and user data.

Exploit preconditions

  • Attack surface: HTTP(S) endpoint /classes/Users.php?f=save exposed by the web application.
  • Required access: Ability to send requests to the application (usually anonymous or low-privileged web access).
  • Trigger point: Supplying specially crafted values in the ID parameter (or related input) that are concatenated into SQL queries.
  • Why exploitation is possible: The application constructs SQL queries by directly embedding user-controlled input without parameterization or sufficient escaping, allowing modification of 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 save function in Users.php likely builds SQL statements through string concatenation, inserting the ID parameter and possibly other fields directly into the query.

Because these values are not handled with prepared statements or strict validation, attackers can inject SQL control characters and clauses, altering the intended query.

The reference to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component reflects that unsafe input flows into the database engine, a downstream interpreter, without appropriate neutralization.

Potential impact

  • May read sensitive patient records and user account details from the database.
  • Could modify or delete patient data, appointments, or user accounts.
  • May create or escalate accounts with administrative privileges within the application.
  • Could disrupt application functionality or cause data integrity issues by altering queries.
  • In some environments, may lead to further compromise if database access can be chained to other weaknesses (e.g., reading configuration secrets).

General mitigation guidance

Effective mitigation focuses on breaking the direct trust between user input and SQL construction:

  • Prefer parameterized queries or prepared statements for all database operations, ensuring user-controlled data is always treated as parameters, not query text.
  • Apply strict server-side validation and normalization on identifier fields like ID, enforcing expected formats (e.g., integers only) and rejecting unexpected input.
  • Centralize database access logic to reduce ad-hoc query building and allow consistent security patterns.
  • Limit database privileges for the application user to only the operations and tables required, reducing impact if injection occurs.
  • Consider introducing an abstraction or ORM that encourages safe-by-default query composition.

How teams detect issues like this

Organizations can identify this vulnerability class using a combination of code and behavior analysis:

  • Static analysis: Configure rules to flag dynamic SQL construction in PHP files, especially where $_GET, $_POST, or other request variables are concatenated into queries without parameterization.
  • Code review: Look for repeated patterns of "SELECT ... WHERE id='$id'" or similar constructs, and verify that all user inputs flow through prepared statements or sanitized APIs.
  • Dynamic testing: Use automated security testing tools or fuzzers that send malformed or SQL-specific payloads to endpoints like /classes/Users.php?f=save and observe for database error messages or unexpected responses.
  • Policy enforcement: Establish coding standards requiring prepared statements and enforce them via pre-commit hooks, CI checks, or secure coding training.

Sources

SourceLink
github.comgithub.com/zzb1388/cve2/issues/3
vuldb.comvuldb.com/cve/CVE-2026-10185
vuldb.comvuldb.com/submit/819918
vuldb.comvuldb.com/vuln/367466
vuldb.comvuldb.com/vuln/367466/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Yes. As long as the affected endpoint is accessible over the network, an attacker can exploit the SQL injection by sending crafted HTTP requests, even without prior authentication in many configurations.

Typically, only the ability to reach the web application over HTTP(S) is required. No direct database access is needed; the application acts as the conduit to the database.

Refactor the affected database interactions to use prepared statements or parameterized queries everywhere user input reaches SQL, alongside strict input validation for IDs and other critical parameters.

Adopt a secure coding standard that mandates parameterized queries, provide developer training on injection risks, and integrate static analysis or security checks into the development pipeline to catch unsafe query construction early.

Find out what's already
exploitable in your codebase.