Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with admin/super and patients/med write access
-
DeliveryInject SQL into layout field_id via edit_layout.php
-
ExploitStore crafted HIS or source-H LBF field identifier
-
ExecutionPOST to history_save.php for patient lacking a history_data row
-
ImpactExecute SQL function inside INSERT (SLEEP worker exhaustion or cross-tenant data read)
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 | Exploitation requires an authenticated account holding BOTH admin/super (to add the malicious layout field) AND write or add-only access to patients/med (to trigger the History save). The attacker crafts a field identifier containing SQL - either a HIS field via interface/super/edit_layout.php (which stays stored in layout_options even after the Layout Editor reports it as an invalid column) or a source-'H' field in any LBF* layout (which receives no column validation at all because tableNameFromLayout() returns an empty table name). The crucial precondition is that the target patient must NOT already have a history_data row: opening history.php/history_full.php creates that row, so the payload must be delivered by POSTing directly to history_save.php (or the LBF save) against fresh patient records. The SQL is constrained by the column-identifier length (the demonstrated payload is 24 characters), limiting available expressions. Limiting factors: high operator privilege required, no user interaction, no public auto-exploitation, and the narrow no-history-row target condition - so realistic risk is concentrated in multi-tenant deployments where the scope change permits access beyond the administrator's own tenant. |
| Impact | This is a genuine but low-urgency issue. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:H/UI:N/VC:L/VI:L/VA:L/SC:H/SI:N/SA:N, base 4.6, medium) is dominated by two limiting metrics: AC:H and PR:H. The advisory confirms PR:H in concrete terms - the attacker needs an account holding BOTH admin/super AND write (or add-only) access to patients/med, which is already a highly trusted operator role. The SSVC-style Decision label is 'this_month' (not act_now/emergency), consistent with a self-authorized, high-privilege flaw. No EPSS score and no KEV status were provided in the input, and there is no CISA KEV listing, so there is no signal of active exploitation; exploitation status is best described as a documented proof-of-concept existing in the vendor advisory rather than confirmed in-the-wild use. The impacts are individually low: SLEEP-style payloads tie up database/web workers (availability), compact expressions can surface database-generated values such as version or database name (confidentiality), and crafted keys write into History columns (integrity). The one escalation that matters is SC:H / scope change: in a multi-tenant deployment the injection can reach data beyond what even the administrator is authorized to access. Net assessment - a real, patch-worthy integrity/confidentiality weakness, but NOT an emergency: the high privilege precondition means a single-tenant operator who could abuse this already has near-total control, so the incremental risk concentrates on multi-tenant hosts. EPSS is absent rather than low, so probabilistic exploitation likelihood cannot be stated from the input. |
| Exploit ScenarioDerived | A user holding admin/super plus patients/med write access (for example a tenant administrator on a shared OpenEMR host) saves a History-layout field whose identifier embeds SQL such as 'tobacco |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 13, 2026
Stored SQL injection in OpenEMR before 8.5.0 allows an account holding both admin/super rights and write (or add-only) access to patients/med to save a crafted History layout field whose identifier contains SQL, which is later concatenated unvalidated into the INSERT that creates a patient's history_data row. Because the trigger only fires for patients who do not yet have a history_data row and the identifier is limited to roughly 24 characters, the demonstrated effect is persistent execution of compact database functions such as SLEEP(3) - tying up database and web workers - or placing database-generated values into a History column, with the meaningful impact concentrated on multi-tenant deployments where the resulting scope change reaches data beyond the administrator's own tenant. A detailed public proof-of-concept procedure is published in the upstream GitHub security advisory; the issue is not listed in CISA KEV and no confirmed active exploitation is reported. This is a genuine but low-urgency issue given the high combined privilege prerequisite and the narrow fresh-patient precondition.
RemediationAI
Vendor-released patch: upgrade to OpenEMR 8.5.0, which is the fixed version per the upstream package data and GHSA-fq58-jp5g-x44q (https://github.com/openemr/openemr/security/advisories/GHSA-fq58-jp5g-x44q). The upstream recommendation is to validate every layout field_id before insertion - including identifiers in vertical LBF* layouts whose source writes to a column-oriented table - to have SocialHistoryService accept only real history_data columns with each identifier quoted, and to wrap the layout metadata insert and schema change in a single transaction so a rejected column cannot remain active. Where upgrading must be deferred, the practical compensating controls are: separate the admin/super role from patients/med write or add-only access so no single account can both plant and trigger a payload (this breaks existing combined administrator workflows); audit layout_options.field_id for backticks, commas, parentheses or other identifier punctuation and remove suspicious HIS and LBF source-'H' fields, noting that deleting a field does not clean history_data rows already written for patients; and ensure every patient record has an existing history_data row so the vulnerable INSERT path is not reached, understanding that opening a patient's History page creates that row and that routine page views therefore silently narrow the attack surface only for patients visited at least once. Monitor for abnormal latency or SLEEP-style delays on history_save.php requests as a detection signal.
Affected VersionsENISA
Affected Packages
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
OpenEMR is a PHP/MySQL electronic medical record platform whose Layout Editor (interface/super/edit_layout.php) writes form field definitions into the layout_options table. In the vulnerable flow the supplied newid is inserted into layout_options first, and only afterwards does addOrDeleteColumn() reject punctuation that cannot appear in a column name - with no transaction rolling back the metadata row, a HIS field such as tobacco=sleep(3),exams remains stored and active even though the editor reports an invalid SQL identifier. A source-'H' field in any LBF* layout skips validation entirely because tableNameFromLayout() deliberately returns an empty table name for LBF layouts, so addOrDeleteColumn() returns before checking the identifier. History saving (interface/patient_file/history/history_save.php, or interface/forms/LBF/new.php for LBF saves) reads active fields from layout_options and uses the stored field_id as an array key; SocialHistoryService::insertRecord() parameterizes the values but interpolates those keys between backticks when building "insert into history_data set pid = ?, date = NOW(), uuid = ? ...", never validating them against the real history_data columns. The flaw is CWE-89 (SQL injection) and requires a patient with no existing history_data row, since opening history.php or history_full.php creates that row and taking the normal update path avoids the key-concatenating INSERT; with permissive SQL mode the empty auto-increment id does not block the statement. The identifier length limit constrains the payload, so exploitation yields persistent function execution and data exfiltration of compact expressions rather than arbitrary query control.
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
CVSS:4.0/AV:N/AC:H/AT:N/PR:H/UI:N/VC:L/VI:L/VA:L/SC:H/SI:N/SA:N
PR:H because exploitation needs both admin/super and patients/med write; AC:H for the no-history-row precondition and length-limited payload; S:C as a multi-tenant injection reaches data beyond the administrator's authorization; C/I/A:L for limited data read, column writes, and worker exhaustion.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
OpenEMR before 8.5.0 contains a stored SQL injection vulnerability in which History layout field identifiers saved through edit_layout.php, including HIS fields and LBF source-H fields, are placed unvalidated into an INSERT statement for patients without a history_data row. Users with admin/super and patients/med write access can trigger history_save.php or LBF saves to execute SQL functions like SLEEP, tying up database workers or accessing data beyond their privileges.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
An authenticated SQL injection vulnerability exists in OpenEMR ≤ 4.1.1 Patch 14 that allows a low-privileged attacker to
Unauthenticated token disclosure in OpenEMR before 8.0.0. CVSS 10.0. PoC and patch available.
Path traversal in OpenEMR 7.0.4 disposeDocument() allows file access. PoC available.
Path traversal in OpenEMR electronic health records before fix allows authenticated users to read arbitrary files on the
SQL injection in OpenEMR electronic health records before fix. Authenticated users can execute arbitrary SQL through the
OpenEMR 7.0.2 is vulnerable to SQL Injection via \openemr\library\classes\Pharmacy.class.php, \controllers\C_Pharmacy.cl
An issue in OpenEMR 7.0.2 allows a remote attacker to escalate privileges viaa crafted POST request using the noteid par
Information disclosure in OpenEMR 5.0.2 to before 8.0.0 exposes sensitive data. PoC and patch available.
Remote code execution in OpenEMR through 8.2.0 lets an authenticated administrator poison the document category tree so
interface/fax/fax_dispatch.php in OpenEMR 4.1.0 allows remote authenticated users to execute arbitrary commands via shel
Authenticated low-privilege users can exploit OpenEMR before 8.3.0 to read and write arbitrary files through the fax/sms
interface/globals.php in OpenEMR 2.x, 3.x, and 4.x before 4.2.0 patch 2 allows remote attackers to bypass authentication
EUVD-2026-125018
GHSA-vm63-33hr-fxhw
NVD
CVE.org
EPSS
Exploit-DB