Cross-site Scripting (XSS) - Stored in openemr/openemr
Reported on
May 10th 2022
Description
openemr / openemr is vulnerable to Cross-site Scripting (XSS) - Stored
Proof of Concept
// Poc
<script>alert(document.cookie)</script>
steps to reproduce:
1) login open emr patient portal https://demo.openemr.io/openemr/portal/index.php
2) goto my profile in https://demo.openemr.io/openemr/portal/home.php
3)click on pending review.
4)add the payload in the first name /middle name (<script>alert(document.cookie)</script>)
5) click submit changes
6) after that we get an with Error: Patient was successfully updated
7) on clicking pending review the xss wil be triggered
Impact
This vulnerability has the potential to steal a user's cookie and gain unauthorized access to that user's account through the stolen cookie.
A preliminary fix for this has been placed in our development codebase at https://github.com/openemr/openemr/commit/152e551208e6de534ab194c87e9ffa4d56d294a8
The fix will officially be released in the next OpenEMR 6.1.0 patch 2 (6.1.0.2). After we release this patch, I will then mark this item as fixed (probably in about a month).
If the maintainer is happy to proceed, we can assign and publish a CVE for this report 👍
Hi, Lets not make this public until we release this fix in our next patch (6.1.0.2), which will likely be in several weeks. I will let you know when we release the patch and will then I will mark this item as officially fixed. thanks.
This was fixed in OpenEMR 7.0.0, which was just released.