
Cloud Vulnerability DB
A community-led vulnerabilities database
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).
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).
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).
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).
user/appointment.read, user/patient.read, or user/Patient.read.authorization_code flow against the OpenEMR authorization server, authenticating as the registered client.user/appointment.write) instead of the registered read scope (user/appointment.read).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.user/<resource>.write, which maps to create, update, and delete permissions in ScopePermissionObject.AuthorizationListener accepts these requests because the token contains the required write scope entities (GitHub Advisory).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.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.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).
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).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."