CVE-2026-40508

OpenEMR < 8.3.0 Stored XSS via Patient Portal Template Import Handler

Published Aug 19, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
OpenEMR before 8.3.0 contains a stored cross-site scripting vulnerability in the patient portal template import handler that allows authenticated attackers with Forms Administration permissions to upload template files containing arbitrary HTML or JavaScript. Attackers can inject malicious scripts through the template upload functionality, which are stored without sanitization and execute in the browser of any other Forms Administration user who views the template in the HTML editor.

Analysis

AI-generated

Technical impact

The flaw allows a user with Forms Administration permissions to upload a patient portal template that contains arbitrary HTML or JavaScript. Because the input is not sanitized, the injected code is stored and later executed in the browser of any other Forms Administration user who opens the template in the HTML editor, giving the attacker the ability to steal cookies, deface the interface, or perform further client‑side attacks.

Affected Systems

OpenEMR versions earlier than 8.3.0 are vulnerable. Specifically, any release of the OpenEMR application where the patient portal template import handler is present and lacks input sanitisation. This includes all current builds prior to the 8.3.0 release.

Risk and Exploitability

The CVSS score of 5.1 indicates a medium severity vulnerability, and the EPSS score of 0.00171 indicates a very low probability of exploitation. Because the attack requires an authenticated user with Forms Administration rights, the likelihood of exploitation is limited to environments where such permissions are granted. The vulnerability is included in the web interface of the application, so the attacker can trigger it through a browser session. The vulnerability is not listed in the CISA KEV catalog.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the OpenEMR 8.3.0 release or later, which removes the unsanitised template upload path.
  • Immediately audit and delete any patient portal templates that may contain malicious code or were uploaded prior to the patch.
  • Restrict Forms Administration privileges to only trusted personnel and review the necessity of those permissions.

Generated by OpenCVE AI on August 20, 2026 at 15:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Open-emr
Open-emr openemr
CPEs cpe:2.3:a:open-emr:openemr:*:*:*:*:*:*:*:*
Vendors & Products Open-emr
Open-emr openemr
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Openemr
Openemr openemr
Vendors & Products Openemr
Openemr openemr
Type Values Removed Values Added
Description OpenEMR before 8.3.0 contains a stored cross-site scripting vulnerability in the patient portal template import handler that allows authenticated attackers with Forms Administration permissions to upload template files containing arbitrary HTML or JavaScript. Attackers can inject malicious scripts through the template upload functionality, which are stored without sanitization and execute in the browser of any other Forms Administration user who views the template in the HTML editor.
Title OpenEMR < 8.3.0 Stored XSS via Patient Portal Template Import Handler
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 1, 2026, 3:19 PM
Reserved
Apr 13, 2026, 8:29 PM
Status
Deferred
Published
Aug 19, 2026, 3:17 PM
Modified
Oct 27, 2026, 1:10 PM