Skip to main content

OpenEMR CVE-2026-126491

| EUVDEUVD-2026-125133 HIGH
SQL Injection (CWE-89)
2026-11-13 VulnCheck GHSA-pfrx-3wpm-pv74
8.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Admin/super plants malicious field_id via Layout Editor
  2. Delivery
    Low-privilege user runs patient search findBy=Any
  3. Exploit
    Payload concatenated into patient_data WHERE clause
  4. Execution
    Stored SQL injection executes
  5. Persist
    Exfiltrate patient_data records and users_secure bcrypt hashes
  6. Impact
    Crack offline to escalate to admin

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two-stage, second-order injection. Stage 1 (plant) requires a user with Layout Editor access - admin/super via interface/super/edit_layout.php - to persist a malicious value into layout_options.field_id; the value is limited to varchar(31), but useful predicates fit (the '1 OR 1=1' PoC is 8 chars, 'EXTRACTVALUE(1,USER())' is 22). Stage 2 (trigger) requires only an authenticated low-privilege account plus a CSRF token, calling interface/main/finder/patient_select.php with findBy=Any to reach getByPatientDemographics(); no ACL check (AclMain::aclCheckCore) gates that endpoint. Limiting factors: the high-privilege plant step is mandatory (PR:H), exploitation is confined to authenticated users, and the openemr DB account is least-privileged (file_priv=N, no stacked queries) which gates direct INTO OUTFILE RCE and confines impact to read-oriented exfiltration (e.g. patient_data, users_secure).

Impact

Severity signals are moderately high but not emergency-grade. The input CVSS 4.0 score is 8.3 (High) with AV:N/AC:L/AT:N/PR:H/UI:N and VC:H/SC:H, and the vuln.today Decision label is 'this_week' (priority, not act_now/emergency). It is NOT listed in CISA KEV (no active-exploitation signal), and no EPSS probability was supplied, so widespread automated exploitation cannot be inferred from the data. The dominant limiting factor is PR:H: the stored/second-order injection must first be planted by a user with Layout Editor access (admin/super via edit_layout.php), which is why CVSS correctly uses PR:H rather than PR:N even though the eventual trigger needs only a low-privilege account. This makes the realistic threat model malicious-insider or post-admin-compromise/chaining rather than an internet-wide unauthenticated mass-exploit, and it reconciles the high CVSS with the 'this_week' (not emergency) decision and the absence of KEV. A detailed, demonstrated PoC exists in the GHSA advisory (step-by-step Docker reproduction with observed data leak), so exploitation is well understood and reproducible; treat it as a priority patch rather than a drop-everything zero-day. Note the advisory frames this as an INCOMPLETE FIX of CVE-2026-33910 - the same class was patched in a sibling function but left reachable in getByPatientDemographics(), so organizations that believed they were covered by the prior CVE may still be exposed.

Exploit ScenarioDerived

A malicious or compromised admin/super user plants a SQL payload (e.g. the original '1 OR 1=1') into a Demographics layout field_id via the Layout Editor, where it is persisted in layout_options. Any authenticated low-privilege user (e.g. Front Office) then runs a patient search with findBy=Any, concatenating the planted field_id into the patient_data WHERE clause and exfiltrating records including bcrypt password hashes from users_secure. A working PoC with observed output is published in the GHSA advisory; because the DB user is least-privileged (no stacked queries, file_priv=N), direct INTO OUTFILE RCE is gated and the realistic path is hash exfiltration → offline crack → admin.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 13, 2026

OpenEMR versions before 8.5.0 retain a stored (second-order) SQL injection in getByPatientDemographics() in library/patient.inc.php, the same code path an earlier advisory (CVE-2026-33910) claimed to have fixed in 8.0.0.3 but which was only corrected in the sibling function getByPatientDemographicsFilter(). An attacker holding Layout Editor privileges plants a crafted layout_options.field_id, after which any authenticated low-privilege user who submits a patient search with findBy=Any executes the injected SQL and can read patient_data and users_secure, including bcrypt password hashes. The upstream advisory includes a public Docker-based proof-of-concept reproduction; active exploitation in the wild is not confirmed (no CISA KEV listing) and the vulnerability is prioritized as 'this_week' by vulnerability.today.

RemediationAI

Upgrade to OpenEMR 8.5.0, the fixed release published by the vendor (vendor-released patch: 8.5.0); this is the only complete remediation because it replaces the add_escape_custom() identifier concatenation in getByPatientDemographics() with proper column-name validation, matching the already-fixed getByPatientDemographicsFilter(). Verify the deployed version rather than assuming 8.0.0.3 is sufficient, since that release addressed only the sibling function. Where upgrading must be staged, the mandatory plant step can be disrupted by restricting interface/super/edit_layout.php and the admin/super role to a minimal, audited set of trusted administrators and by auditing existing layout rows for non-identifier field_id values (for example anything matching '1 OR 1=1' or containing spaces, parentheses or SELECT/OR tokens) in the DEM form; the trade-off is that any still-compromised or malicious admin can re-plant a payload, so this only reduces exposure and does not remove it, and legitimate custom layout fields would need review before deletion. Additionally, because the trigger endpoint performs no ACL check beyond login, limiting which accounts can reach interface/main/finder/patient_select.php with findBy=Any reduces the blast radius from any low-privilege Front Office account, at the cost of narrowing normal patient-search functionality. The least-privileged openemr database account limits but does not prevent data exfiltration, and exfiltrated users_secure hashes can be cracked offline, so treat any exposure window as a potential credential compromise and rotate administrator passwords if tampering with layout_options is detected. Advisories: https://github.com/openemr/openemr/security/advisories/GHSA-pc2q-9pcw-v899 and https://www.vulncheck.com/advisories/openemr-before-8.5.0-sql-injection-via-getbypatientdemographics-in-patient-inc-php.

Affected VersionsENISA

OpenEMR 0 <8.5.0

Affected Packages

euvd openemr fix: 8.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected code is PHP/MySQL: library/patient.inc.php builds a dynamic WHERE clause from the field_id values stored in layout_options for the DEM (demographics) form and concatenates each one as a SQL identifier using add_escape_custom(), which is a thin wrapper around mysqli_real_escape_string(). That function escapes string-literal metacharacters and is useless in identifier context, so a field_id such as '1 OR 1=1' becomes part of the query text executed by sqlStatement() at roughly line 699. The correct primitive already exists 30 lines below in getByPatientDemographicsFilter(), which validates the value with escape_sql_column_name() against the actual SHOW COLUMNS of patient_data and backtick-quotes it; the fix was simply never propagated to the older function, making this an incomplete-remediation/drift issue (CWE-89, with the upstream advisory also tagging CWE-1188). The plant primitive is interface/super/edit_layout.php: the INSERT into layout_options succeeds before addOrDeleteColumn() aborts on field names outside [A-Za-z0-9_], and the UPDATE branch is unconditionally permissive; field_id is varchar(31), which is long enough for blind predicates but not for long stacked statements. The trigger is interface/main/finder/patient_select.php with findBy=Any, which enforces only login and a CSRF token and performs no AclMain::aclCheckCore check. Because the openemr database account is least-privileged (file_priv=N, no stacked queries), direct INTO OUTFILE code execution is gated; the realistic escalation chain is hash exfiltration from users_secure, offline cracking, admin takeover, and then admin-level primitives such as modules, backup or globals. Consistent with the assessed vector (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:N), the plant step requires high privilege while the trigger step needs only a low-privilege authenticated session.

Know when Openemr gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.3 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N
vuln.today AI 7.6 HIGH

PR:H because planting requires Layout Editor (admin/super) access; S:C and C:H because the stored payload lets lower-privilege users exfiltrate cross-table data including users_secure hashes; I:L limited, A:N none.

3.1 AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Nov 13, 2026 - 10:02 EUVD
CVE Published
Nov 13, 2026 - 09:34 cve.org
HIGH 8.3

DescriptionCVE.org

OpenEMR before 8.5.0 contains a stored SQL injection vulnerability in getByPatientDemographics() where layout_options field_id values are concatenated into the patient search WHERE clause. Attackers with Layout Editor access can plant a malicious field_id, allowing any authenticated low-privilege user to exfiltrate data from patient_data and users_secure tables.

Technical POC Analysis

CWE-89, stored/second-order SQL injection in getByPatientDemographics() in library/patient.inc.php.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A high-severity SQL injection in OpenEMR before version 8.5.0 allows attackers with Layout Editor access to expose sensitive patient data and hashed credentials, potentially compromising the entire patient database. This flaw, previously reported but incompletely fixed, puts protected health information at risk and could lead to regulatory penalties and reputational damage. Leadership should prioritize immediate remediation.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 71% exploitable
Prevalence
Medium
leading open-source EHR, but healthcare-vertical deployment only
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

CVE-2013-10044 HIGH POC
8.7 Aug 01

An authenticated SQL injection vulnerability exists in OpenEMR ≤ 4.1.1 Patch 14 that allows a low-privileged attacker to

CVE-2026-24898 CRITICAL POC
10.0 Mar 03

Unauthenticated token disclosure in OpenEMR before 8.0.0. CVSS 10.0. PoC and patch available.

CVE-2026-24848 CRITICAL POC
9.9 Mar 03

Path traversal in OpenEMR 7.0.4 disposeDocument() allows file access. PoC available.

CVE-2026-24849 CRITICAL POC
9.9 Feb 25

Path traversal in OpenEMR electronic health records before fix allows authenticated users to read arbitrary files on the

CVE-2026-24908 CRITICAL POC
9.9 Feb 25

SQL injection in OpenEMR electronic health records before fix. Authenticated users can execute arbitrary SQL through the

CVE-2024-22611 CRITICAL POC
9.8 Apr 03

OpenEMR 7.0.2 is vulnerable to SQL Injection via \openemr\library\classes\Pharmacy.class.php, \controllers\C_Pharmacy.cl

CVE-2024-37734 CRITICAL POC
9.8 Jun 26

An issue in OpenEMR 7.0.2 allows a remote attacker to escalate privileges viaa crafted POST request using the noteid par

CVE-2026-25146 CRITICAL POC
9.6 Mar 03

Information disclosure in OpenEMR 5.0.2 to before 8.0.0 exposes sensitive data. PoC and patch available.

CVE-2026-39932 CRITICAL POC
9.4 Aug 03

Remote code execution in OpenEMR through 8.2.0 lets an authenticated administrator poison the document category tree so

CVE-2012-0992 HIGH POC
8.5 Feb 07

interface/fax/fax_dispatch.php in OpenEMR 4.1.0 allows remote authenticated users to execute arbitrary commands via shel

CVE-2026-124450 CRITICAL POC
9.3 Nov 08

Authenticated low-privilege users can exploit OpenEMR before 8.3.0 to read and write arbitrary files through the fax/sms

CVE-2015-4453 MEDIUM
5.0 Jul 05

interface/globals.php in OpenEMR 2.x, 3.x, and 4.x before 4.2.0 patch 2 allows remote attackers to bypass authentication

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy