/

CVE-2026-104637

Severity:

HIGH RISK

(7.3)

Unrestricted Upload (CWE-434) in HospitalManagementSystem

CVE-2026-104637

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-284, CWE-434

Impact:

Unauthorized File Upload and Potential Server-Side Code Execution

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

A remotely reachable file-upload weakness in HospitalManagementSystem affects patient, physician, and account operations that process the img argument. If an attacker can submit crafted upload content, the application may store files without sufficiently restricting their type or destination, potentially enabling unauthorized content placement or further compromise depending on server configuration.

Affected context

The issue occurs in the PHP controller's add_patient, add_physician, add_account, update_account, update_subaccount, edit_physician, and edit_patient functions when handling the img argument. Deployments may be exposed when these endpoints are remotely accessible and upload validation, storage permissions, or web-server execution controls do not adequately constrain submitted files.

Exploit preconditions

  • Attack surface: Remotely accessible HTTP application endpoints that process image-related input
  • Required access: Access sufficient to invoke one or more affected patient, physician, or account operations; the exact authorization requirement depends on deployment configuration
  • Trigger point: Processing of the img argument during an affected create or update operation
  • Why exploitation is possible: Upload content may not be reliably restricted to permitted image formats, safe filenames, and non-executable storage locations

Why this happens

The underlying weakness is insufficient control over user-supplied file uploads. When an application accepts the img argument without enforcing content validation, safe naming, size limits, and isolated storage, an attacker may cause unintended files to be written to the server. This maps primarily to CWE-434: Unrestricted Upload of File with Dangerous Type; CWE-284: Improper Access Control is also relevant where endpoint permissions or upload authorization are inadequately enforced.

Potential impact

  • An attacker may place unauthorized files on the application server
  • Sensitive application content could be overwritten or disrupted
  • Stored malicious content could affect users who access it
  • Server-side code execution could occur if uploaded files are stored in an executable web-accessible location
  • The application or hosted data could be compromised

General mitigation guidance

Mitigation generally focuses on reducing trust in uploaded content and separating uploaded data from executable application resources.

Common defensive patterns include:

  • Allowing only narrowly defined image formats and validating file signatures in addition to extensions
  • Generating server-side filenames rather than trusting client-provided names or paths
  • Storing uploads outside web-accessible and executable directories where feasible
  • Applying strict size, dimension, and quantity limits
  • Enforcing authorization checks independently for every affected operation
  • Disabling script execution in upload locations and applying least-privilege filesystem permissions
  • Serving uploaded content with safe response headers and an appropriate content-disposition policy
  • Rejecting unexpected input before persistence and logging upload decisions for review

How teams detect issues like this

High-level detection can combine:

  • Static analysis for file-write operations that use request parameters as names, paths, or content without validation
  • Code review checks for extension-only validation, client-controlled filenames, and web-accessible upload directories
  • Dynamic testing with benign non-image files, mismatched content types, oversized inputs, and path-like filenames
  • Web-server and application monitoring for unusual upload extensions, unexpected upload locations, and execution attempts in media directories
  • Policy enforcement requiring centralized upload-validation utilities and explicit authorization checks
  • Automated security review tools to flag unrestricted upload patterns and unsafe file-handling flows

Sources

SourceLink
github.comgithub.com/onetwothreeneth/HospitalManagementSystem/
github.comgithub.com/onetwothreeneth/HospitalManagementSystem/issues/5
vuldb.comvuldb.com/cve/CVE-2026-104637
vuldb.comvuldb.com/submit/963707
vuldb.comvuldb.com/vuln/412925
vuldb.comvuldb.com/vuln/412925/cti

Frequently asked

questions

It may be remotely exploitable when affected controller operations are reachable over the application interface and the attacker can satisfy any required authentication or authorization checks.

Not necessarily. The required access depends on how the affected endpoints are exposed and protected; access to an operation that accepts the img argument is the key prerequisite.

Restrict uploads to validated image content, generate safe server-side names, store files outside executable web paths, and enforce authorization and filesystem least privilege.

Use a centralized upload-handling policy, validate content server-side, isolate uploaded data, apply execution restrictions, and continuously test upload endpoints for unexpected file types and destinations.

Find out what's already
exploitable in your codebase.