Vulnerability DatabaseCVE-2026-126494

CVE-2026-126494: 
OpenEMR vulnerability analysis and mitigation

Overview

CVE-2026-126494 is an improper authorization vulnerability in OpenEMR's SMART/OAuth scope finalization logic that allows read-only clients to escalate their permissions and obtain write-capable token scopes. The flaw exists in ScopeRepository::finalizeScopes(), which relies on ScopeEntity::containsScope() to enforce scope restrictions, but containsScope() fails to verify that the registered scope actually grants write permissions before approving the requested write scope. All OpenEMR versions before 8.4.0 are affected; version 8.4.0 contains the fix. It carries a CVSS v3.1 base score of 7.1 (High) (GitHub Advisory, Feedly).

Technical details

The root cause is CWE-863 (Incorrect Authorization) in ScopeRepository::finalizeScopes() (commit acdd996). When finalizing OAuth scopes, the method calls ScopeEntity::containsScope() to check whether a requested scope is within the client's registered scopes. However, containsScope() evaluates the requested scope's legacy alias flags (v1Read, v1Write) rather than comparing them against the registered scope's actual permissions — meaning if the requested scope has v1Write = true, the check returns true regardless of what the client was registered for. This is compounded by ScopePermissionObject::createFromString(), which maps the read alias to {read, search} and the write alias to {create, update, delete} — materially different permission sets. An attacker with a client registered for user/<resource>.read can request user/<resource>.write during the OAuth authorization flow, and the finalized token will carry write scopes that satisfy c, u, and d authorization checks in the REST layer (GitHub Advisory).

Impact

Successful exploitation allows an authenticated SMART/OAuth client approved only for read-only access to create, update, and delete appointments and patient data — highly sensitive protected health information (PHI). The integrity impact is high, as attackers can tamper with or destroy clinical records, while availability is partially affected through unauthorized deletions. Confidentiality is not directly impacted by this vulnerability, but data manipulation in an EHR system carries significant patient safety and regulatory (HIPAA) consequences (GitHub Advisory, Feedly).

Exploitability

A proof-of-concept (PoC) is publicly available in the GitHub Security Advisory, validated against OpenEMR commit acdd99694b45e1f384060e10ca1af1b0de629069. The PoC is a PHP harness that demonstrates in-memory scope escalation without requiring a full browser OAuth flow. Exploitation requires a registered SMART/OAuth confidential client with at least a user/<resource>.read scope — meaning some level of prior authenticated access is needed. The EPSS score is approximately 0.0035, and there is no evidence of in-the-wild exploitation or CISA KEV catalog inclusion at this time. NVD SSVC classifies exploitation status as "poc" and technical impact as "partial" (GitHub Advisory, Feedly).

Exploitation steps

  1. Obtain a registered SMART/OAuth client: Register or obtain credentials for a confidential SMART/OAuth client in the target OpenEMR instance that has been approved for a read-only scope such as user/appointment.read, user/patient.read, or user/Patient.read.
  2. Initiate the OAuth authorization flow: Begin a standard OAuth 2.0 authorization_code flow against the OpenEMR authorization server, authenticating as the registered client.
  3. Request write scope instead of read scope: In the scope parameter of the authorization request, specify the corresponding write scope (e.g., user/appointment.write) instead of the registered read scope (user/appointment.read).
  4. Exploit the flawed finalizeScopes() logic: The server calls ScopeRepository::finalizeScopes(), which invokes ScopeEntity::containsScope(). Because containsScope() checks the requested scope's v1Write flag (which is true) rather than verifying the registered scope grants write permissions, it returns true and preserves the write scope in the finalized token.
  5. Receive a write-capable access token: The issued access token contains user/<resource>.write, which maps to create, update, and delete permissions in ScopePermissionObject.
  6. Perform unauthorized write operations: Use the access token to issue HTTP POST (create), PUT/PATCH (update), or DELETE requests against OpenEMR REST API endpoints for appointments or patient data. The AuthorizationListener accepts these requests because the token contains the required write scope entities (GitHub Advisory).

Indicators of compromise

  • Network: OAuth token requests where the scope parameter contains user/<resource>.write for a client that was registered only for user/<resource>.read; unexpected POST, PUT, PATCH, or DELETE requests to OpenEMR REST API endpoints (e.g., /apis/default/api/appointment, /apis/default/fhir/Patient) from SMART/OAuth clients.
  • Logs: OpenEMR application logs showing finalizeScopes preserving write scopes for clients with read-only registrations; access logs with HTTP 200 responses to write-method API calls from clients not expected to have write access; OAuth server logs showing scope mismatches between registered and issued scopes.
  • Application Behavior: Unexpected creation, modification, or deletion of appointment or patient records; audit trail entries showing write operations attributed to clients or users with read-only authorization levels (GitHub Advisory).

Mitigation and workarounds

Upgrade OpenEMR to version 8.4.0 or later, which contains the fix for the flawed containsScope() logic. As an interim measure, administrators should audit all existing SMART/OAuth client registrations to ensure scope assignments are minimal and appropriate, and consider temporarily disabling SMART/OAuth API access for clients that do not require it. Implementing additional server-side validation to enforce that issued token scopes strictly match registered client scopes is also recommended as a defense-in-depth measure (GitHub Advisory, VulnCheck Advisory).

Community reactions

The vulnerability was reported by christos-cantina-security (finder), with mcspicyenjoyer identified as the remediation developer and kojiromike as the remediation developer in the GitHub advisory. The advisory was published by OpenEMR maintainer bradymiller on October 28, 2026. No significant broader media coverage or notable social media commentary has been identified beyond the official advisory and VulnCheck tracking (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related OpenEMR vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-126491HIGH8.3
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-126494HIGH7.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-126492HIGH7.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026
CVE-2026-134020MEDIUM6.5
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 23, 2026
CVE-2026-126493MEDIUM4.8
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesNov 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management