CVE-2026-33346
Received Received - Intake
Stored XSS in OpenEMR Patient Portal Enables Staff Browser Exploits

Publication date: 2026-03-19

Last updated on: 2026-03-20

Assigner: GitHub, Inc.

Description
OpenEMR is a free and open source electronic health records and medical practice management application. Prior to 8.0.0.2, a stored cross-site scripting (XSS) vulnerability in the patient portal payment flow allows a patient portal user to persist arbitrary JavaScript that executes in the browser of a staff member who reviews the payment submission. The payload is stored via `portal/lib/paylib.php` and rendered without escaping in `portal/portal_payment.php`. Version 8.0.0.2 fixes the issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-19
Last Modified
2026-03-20
Generated
2026-05-07
AI Q&A
2026-03-19
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
open-emr openemr to 8.0.0.2 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-33346 is a stored cross-site scripting (XSS) vulnerability in OpenEMR versions prior to 8.0.0.2, specifically in the patient portal payment flow.

A patient portal user can submit malicious JavaScript code via the payment submission process, which is stored in the database without proper escaping.

When a staff member later reviews the payment submission, the malicious script is executed in their browser because the stored data is embedded directly into a JavaScript string literal without proper encoding.

This happens because the user input is stored verbatim in the database and then echoed inside a single-quoted JavaScript string in the staff payment review page, allowing the injected script to break out of the string and run arbitrary code.


How can this vulnerability impact me? :

This vulnerability allows a low-privilege patient portal user to execute arbitrary JavaScript code in the browser of any staff member who reviews their payment submission.

  • It can lead to session hijacking of staff members.
  • It can allow unauthorized access to sensitive patient data visible in the staff user interface.
  • It can enable unauthorized actions to be performed on behalf of the staff user.

No special configuration or non-default settings are required for exploitation; the vulnerability exists in the standard patient portal and payment review features.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

[{'type': 'paragraph', 'content': 'This vulnerability can be detected by checking for the presence of malicious JavaScript payloads stored in the patient portal payment flow, specifically in the database column `onsite_portal_activity.table_args` that is populated via `portal/lib/paylib.php`.'}, {'type': 'paragraph', 'content': 'One approach is to query the database for suspicious entries containing JavaScript code or single quotes that could break out of JavaScript string literals.'}, {'type': 'list_item', 'content': "Run a SQL query to find suspicious payloads in the `table_args` column, for example: SELECT * FROM onsite_portal_activity WHERE table_args LIKE '%<script>%' OR table_args LIKE '%\\'%';"}, {'type': 'list_item', 'content': 'Monitor HTTP POST requests to `portal/lib/paylib.php` for suspicious `inv_values` parameters containing JavaScript or single quotes that could be used to inject scripts.'}, {'type': 'list_item', 'content': "Use web application security scanners or custom scripts to simulate POST requests with payloads like `';alert(document.domain);//` to test if the system is vulnerable."}] [1]


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation is to upgrade OpenEMR to version 8.0.0.2 or later, where the vulnerability is fixed.

The fix involves properly escaping user input before embedding it into JavaScript contexts by using functions like `js_escape()` or `json_encode()` with appropriate flags to prevent script injection.

  • Apply the patch that replaces raw string concatenation with safe encoding functions in `portal/portal_payment.php` and `portal/lib/paylib.php`.
  • If immediate upgrade is not possible, consider implementing input validation or filtering on the `inv_values` parameter to block suspicious characters like single quotes or script tags.
  • Limit staff access to the patient portal payment review page until the patch is applied to reduce risk of exploitation.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart