Vulnerability DatabaseCVE-2026-126493

CVE-2026-126493: 
OpenEMR vulnerability analysis and mitigation

Overview

CVE-2026-126493 is a stored cross-site scripting (XSS) vulnerability in OpenEMR before version 8.5.0, affecting the patient portal's onsiteportalactivity API. A low-privileged patient portal user can inject malicious JavaScript via the tableArgs field, which is later executed in a provider or administrator's browser when they interact with the audit review page. The vulnerability was published on October 28, 2026, by researcher Leousum, with the GitHub Security Advisory (GHSA-r4hm-frcj-qr39) serving as the primary disclosure source. It carries a CVSS v3.1 base score of 5.4 (Medium) per NVD, though the GitHub advisory rates it 8.7 (High) with broader confidentiality and integrity impact (GitHub Advisory).

Technical details

The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation), specifically an unquoted HTML attribute injection. The vulnerable endpoint is POST /portal/patient/api/onsiteportalactivity, where the tableArgs field is stored without sufficient sanitization. Although the template at OnsiteActivityViewListView.tpl.php:127 applies _.escape() to the value, the output is placed into an unquoted HTML attribute (data-delete-id=<%= _.escape(item.get('tableArgs') || '') %>), allowing a payload containing spaces to break out of the attribute and inject additional HTML attributes such as onclick=alert(1). Exploitation requires a valid patient portal account and provider/admin interaction with the audit review page at /portal/patient/onsiteactivityviews (GitHub Advisory).

Impact

Successful exploitation allows attacker-controlled JavaScript to execute in the browser session of a privileged provider or administrator, enabling session theft, credential harvesting, and action forgery within the EMR's privileged review interface. Because the script runs in the provider's authenticated context, an attacker could perform unauthorized clinical or administrative actions, access sensitive patient health information, or pivot further within the OpenEMR application. Availability is not directly impacted, but confidentiality and integrity of provider sessions and patient data are at risk (GitHub Advisory).

Exploitability

A proof-of-concept Python script is publicly available in the GitHub Security Advisory, demonstrating the full attack flow using the requests library to POST a crafted tableArgs payload to the vulnerable endpoint. The EPSS score is approximately 0.00235, indicating low current exploitation probability. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The NVD SSVC assessment classifies exploitation status as "poc" and notes the attack is not automatable due to the required provider interaction (GitHub Advisory).

Exploitation steps

  1. Obtain a patient portal account: Register or obtain credentials for a low-privileged patient portal account on a vulnerable OpenEMR instance (version < 8.5.0).
  2. Authenticate and capture session cookies: Log in to the patient portal and capture the session cookies (App=PortalOpenEMR and PortalOpenEMR=<session_token>).
  3. Craft and submit the malicious payload: Send an authenticated POST request to /portal/patient/api/onsiteportalactivity with a JSON body where tableArgs is set to a value that breaks out of the unquoted attribute, e.g., "tableArgs": "1 onclick=alert(1) foo=". For a real attack, replace alert(1) with a payload that exfiltrates the provider's session cookie or performs forged actions.
  4. Confirm storage: Verify the record is stored by checking the API response or querying the activity log.
  5. Wait for provider interaction: The injected payload executes when a provider or administrator navigates to http://<target>/portal/patient/onsiteactivityviews and clicks the delete button on the malicious record, triggering the injected onclick handler in their browser context.
  6. Harvest session or perform actions: The executing JavaScript can steal the provider's session token, perform unauthorized EMR actions, or exfiltrate sensitive patient data (GitHub Advisory).

Indicators of compromise

  • Network: Unusual or unexpected POST requests to /portal/patient/api/onsiteportalactivity containing tableArgs values with spaces and HTML event handler keywords (e.g., onclick, onerror, onmouseover); outbound requests from the provider's browser to unknown external domains following interaction with the audit review page.
  • Logs: OpenEMR application or web server access logs showing POST requests to the onsiteportalactivity endpoint with anomalous tableArgs values; provider access to /portal/patient/onsiteactivityviews shortly after a suspicious patient portal submission.
  • File System: No direct file system artifacts expected for this XSS; however, unexpected changes to OpenEMR configuration or user account settings may indicate follow-on actions taken via the injected script.
  • Database: Records in the onsite_portal_activity table where the table_args column contains HTML event handler strings (e.g., onclick=, onerror=) or JavaScript keywords (GitHub Advisory).

Mitigation and workarounds

Upgrade OpenEMR to version 8.5.0 or later, which addresses this vulnerability. As a workaround prior to patching, administrators should ensure the tableArgs field is properly output-encoded within quoted HTML attributes in OnsiteActivityViewListView.tpl.php, and consider restricting patient portal API access to trusted users. Monitoring API logs for suspicious tableArgs values and limiting provider exposure to the audit review page can reduce risk until patching is complete (GitHub Advisory).

Community reactions

The vulnerability was reported by researcher Leousum and published by OpenEMR maintainer bradymiller via the GitHub Security Advisory program. No significant broader media coverage or notable social media commentary has been identified at this time.

Additional resources


Source: This report was generated using AI

Related OpenEMR vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-126491HIGH8.3
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-126494HIGH7.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-126492HIGH7.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-134020MEDIUM6.5
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 23, 2026
CVE-2026-126493MEDIUM4.8
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management