Stored Cross Site Scripting in openemr/openemr

Valid

Reported on

Mar 11th 2022


Vulnerability Type

Stored Cross Site-Scripting (XSS)

Affected URL

https://localhost/openemr-6.0.0/ /controller.php?practice_settings&document_category&action=add_node&parent_id=XX

Affected Parameter

“name”

Method POST

Authentication Required?

Yes

Issue Summary

A stored XSS vulnerability found in ” /controller.php?practice_settings&document_category&action=add_node&parent_id=XX” that allows authenticated user to inject arbitrary web script in one parameter (name). The XSS payload will be fired in the Patient’s documents list of the affected category name if any authenticated user views it.

Credits

Aden Yap Chuen Zhen (chuenzhen.yap2@baesystems.com) Rizan, Sheikh (rizan.sheikhmohdfauzi@baesystems.com) Ali Radzali
(muhammadali.radzali@baesystems.com)

Recommendation

Ensure to HTML encode before inserting any untrusted data into HTML element content. Ensure all inputs entered by user should be sanitized and validated before processing and storage. Inputs should be filtered by the application, for example removing special characters such as < and > as well as special words such as script.

Issue Reproduction

Login as any user that has privileges to add/edit document categories. Accounting should be able to add document categories. (Administration > Practice > Practice Settings)

Click on Add/Edit in any document categories. In this example, we going to add new sub-category in Patient category with our XSS payload. Insert the payload in Category Name and Click on save category once done.

<script>alert(document.cookie)</script>

The XSS will be fired in the patient’s documents on the sub-category that we have created before. For example, an Admin can go to any patient’s documents and click on any documents with the same parent category (Patient) of the new sub-category that we created (XSS Payload). The cookies of the admin will be pop out in alert box when click on any document (2021-10-10 payload.txt-21)

We are processing your report and will contact the openemr team within 24 hours. a year ago
r00t.pgp modified the report
a year ago
r00t.pgp modified the report
a year ago
r00t.pgp modified the report
a year ago
r00t.pgp modified the report
a year ago
We have contacted a member of the openemr team and are waiting to hear back a year ago
We have sent a follow up to the openemr team. We will try again in 7 days. a year ago
openemr/openemr maintainer validated this vulnerability a year ago
r00t.pgp has been awarded the disclosure bounty
The fix bounty is now up for grabs
openemr/openemr maintainer
a year ago

Maintainer


This has been fixed in latest patch (patch 4) for 6.0.0, which can be found at https://www.open-emr.org/wiki/index.php/OpenEMR_Patches

openemr/openemr maintainer marked this as fixed in 6.0.0.4 with commit 347ad6 a year ago
The fix bounty has been dropped
This vulnerability will not receive a CVE
r00t.pgp
a year ago

Researcher


Hi, Kindly issue a CVE for this vulnerability. Tq

r00t.pgp
a year ago

Researcher


Dear @admin I've already ping the maintainer, could you please follow up on the CVE creation? Tq

Dear @maintainer, could you kindly confirm that CVE can be created for this report? Tq

openemr/openemr maintainer
a year ago

Maintainer


Also note that this fix is in the recently released 6.1.0 version.

I consent to creation of CVE.

Jamie Slome
a year ago

Admin


Sorted 👍

to join this conversation