Cross Site Scripting (reflected) on fee_sheet_ajax.php in openemr/openemr
Reported on
Aug 18th 2022
Description
When testing the app for XSS we found out that the fee_sheet_ajax.php endpoint is actually vulnerable to an XSS exploit.
PoC
- visit https://<openemr-instance>/interface/forms/fee_sheet/review/fee_sheet_ajax.php?task=retrieve&mode=encounters&prev_encounter=%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E
OWASP Category
A03:2021-Injection
Remediation
Add text() to https://github.com/openemr/openemr/blob/master/interface/forms/fee_sheet/review/fee_sheet_ajax.php#L65
Impact
The impact of an exploited XSS vulnerability varies a lot. It ranges from Session Hijacking to the disclosure of sensitive data, CSRF attacks and more. By exploiting a cross-site scripting vulnerability an attacker can impersonate the victim and take over the account. If the victim has administrative rights it might even lead to code execution on the server, depending on the application and the privileges of the account.
Occurrences
Thanks for the report. A preliminary fix has been posted in this PR: https://github.com/openemr/openemr/pull/5695
Please do not create a CVE # or make this vulnerability public at this time. We will make this fix official about 1 week after we release 7.0.0 patch 2 (7.0.0.2), which will likely be in about 1-3 weeks. After we do that, then will be ok to make CVE # and make it public.
Thanks!
Updating that fix is in PR for rel-700 branch which will be in next 7.0.0 patch 2 (7.0.0.2): https://github.com/openemr/openemr/pull/5808 (after we bring this PR in, will then mark this item as fixed)
Plan to "Publish" this about 1 week after we release 7.0.0 patch 2 (7.0.0.2), which will likely be in about 2-4 weeks.
@admin , I made an error in the version that this will be fixed in. It should be 7.0.0.2 and not 7.0.2.
I have updated the fixed version to 7.0.0.2 as requested :)
confirmed, it's no longer vulnerable, @admin can we assign a CVE to this vulnerability?
hi @kusuman, we will likely be releasing the 7.0.0.2 patch this weekend. After we release the 7.0.0.2 patch, then we will "Publish" this vulnerability, which per my understanding will also then assign it a CVE.
@admin, when I published this, I did ensure the CVE toggle was on, but nothing populated/changed in the gui when I did that.
Sorry about that, we changed our UX. We'll make sure it gets a CVE