/

CVE-2026-124448

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in OpenEMR CCDA/CCD Preview HTML

CVE-2026-124448

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-side script execution in a clinician's browser session

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenEMR's CCDA/CCD preview stylesheets can copy attacker-controlled attributes into preview HTML without consistently sanitizing them. An authenticated user who can upload a crafted document may cause script to run in a clinician's session when the document is previewed.

Affected context

The issue occurs in the CCDA/CCD preview rendering path. The cda.xsl stylesheet copies certain event-handler attributes whose values can evade a character denylist, while ccd.xsl copies table-cell attributes into preview HTML without sanitization. Risk arises when an uploaded document containing such attributes is rendered for a clinician.

Exploit preconditions

  • Attack surface: CCDA/CCD document upload and preview functionality
  • Required access: An authenticated account permitted to upload a crafted document
  • Trigger point: A clinician or other user previews the uploaded document
  • Why exploitation is possible: Document attributes can be copied into rendered HTML without effective sanitization, allowing browser event handlers to execute script

Why this happens

This is a cross-site scripting flaw mapped to CWE-79: Improper Neutralization of Input During Web Page Generation. The preview stylesheets copy attacker-controlled attributes into HTML without reliably removing or encoding values for their output context. A character denylist is insufficient when other attribute values or forms can still produce executable event handlers.

Potential impact

  • Script could run in a clinician's browser under the application's origin
  • An attacker may be able to access or alter information available to the affected user
  • The script could perform actions with the clinician's session privileges
  • Trust in rendered clinical documents and preview content may be undermined

General mitigation guidance

Mitigation generally focuses on preventing untrusted document data from becoming executable HTML.

Common defensive patterns include:

  • Avoid copying arbitrary input attributes into rendered markup; allow only explicitly required attributes
  • Apply context-appropriate output encoding and use trusted HTML sanitization where markup is required
  • Prefer safe, structured rendering that treats document values as text rather than active markup
  • Validate uploaded documents against restrictive schemas, while treating validation as an additional control rather than a substitute for output safety
  • Limit application privileges and session capabilities to reduce the consequences of client-side script execution

How teams detect issues like this

Useful detection approaches include:

  • Static analysis for stylesheet transformations that copy untrusted attributes into HTML output
  • Code review of denylist-based sanitization and event-handler attributes such as onmouseover, onclick, and onfocus
  • Tests that render hostile document attributes and verify they are removed or safely encoded
  • Policies that restrict dynamic HTML generation and require approved sanitization for untrusted content

Automated code review tools may help identify risky attribute-copying patterns.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-rghp-vwvf-c2r9
vulncheck.comvulncheck.com/advisories/openemr-before-8.3.0-stored-xss-via-ccda-ccd-preview-xslt-attributes

Frequently asked

questions

An authenticated user with permission to upload a crafted CCDA/CCD document may introduce the content. Script execution depends on another user previewing it.

The uploader needs access to the document upload function. A clinician or other user with access to the preview must open the document for the stored content to trigger.

Do not copy arbitrary document attributes into HTML. Use an explicit attribute allowlist and context-appropriate encoding or sanitization for any retained content.

Treat uploaded documents as untrusted, render their values as text by default, and test preview output for event handlers and other executable markup.

Find out what's already
exploitable in your codebase.