---
id: "CVE-2026-126451"
page: "https://infrastack.ai/live/CVE-2026-126451"
kind: "vulnerability"
aliases: ["CVE-2026-126451"]
title: "OpenEMR: stored XSS lets portal patients run script in staff sessions"
severity: "high"
cvss: 8.5
epss: null
exploited: false
status: "open"
category: "other"
products: []
ecosystems: []
tags: ["healthcare", "openemr", "other", "patient-portal", "self-hosted"]
not_affected_if: ["openemr-8.5.0-or-later", "patient-portal-disabled"]
published_at: "2026-11-13T10:17:52+00:00"
first_seen_at: "2026-11-13T10:47:23+00:00"
updated_at: "2026-11-13T10:50:57+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126451", "first_seen_at": "2026-11-13T10:47:23+00:00"}]
exploit_sources: []
---

# OpenEMR: stored XSS lets portal patients run script in staff sessions

Link for people: https://infrastack.ai/live/CVE-2026-126451 (this .md is for agents)

OpenEMR before 8.5.0 lets a patient using the patient portal store javascript: URLs in document template data that are later rendered unsanitized into an iframe. The script runs in a staff member's session, can read protected health information and CSRF tokens, and call staff or admin endpoints.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the OpenEMR version in the installed application, for example in the admin footer or `version.php` in the web root.
- Confirm whether the patient portal is enabled and reachable by patients.

## Fix

- OpenEMR versions before `8.5.0` are affected; move to `8.5.0` or later.

## Timeline

- 2026-11-13T10:47:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-126451

## Documents

- [advisory] Vendor advisory: github.com https://github.com/openemr/openemr/security/advisories/GHSA-hfpq-j3fj-cpmv
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/openemr-before-8.5.0-stored-xss-via-document-template-rendering

## From the sources

OpenEMR before 8.5.0 contains a stored cross-site scripting vulnerability that allows portal patients to run JavaScript in staff sessions by injecting javascript: URLs into document template_data. Attackers can submit an encounterForm value rendered unsanitized into an iframe src by DocumentTemplateRender, letting the script read PHI and CSRF tokens and call staff or admin endpoints.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
