CVE-2026-40508 OpenEMR < 8.3.0 Stored XSS via Patient Portal Template Import Handler
Authenticated attackers with Forms Administration permissions can inject malicious scripts via template imports, leading to stored XSS execution in other administrators' browsers.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-40508?
CVE-2026-40508 is a medium-severity cross-site scripting vulnerability in openemr, published on 19 Aug 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-79
Which versions are affected by CVE-2026-40508?
How do I fix CVE-2026-40508?
No fix has been published for CVE-2026-40508 yet. Limit exposure of the affected software until one is available.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-40508 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40508 exists.
Sources
Also known as GHSA-5293-8q47-cf44, GHSA-xvw4-236w-442q.