CVE-2026-126491: OpenEMR before 8.5.0 SQL Injection via getByPatientDemographics in patient.inc.php
OpenEMR before 8.5.0 contains a stored SQL injection vulnerability in getByPatientDemographics() where layoutoptions fieldid values are concatenated into the patient search WHERE clause. Attackers with Layout Editor access can plant a malicious fieldid, allowing any authenticated low-privilege user to exfiltrate data from patientdata and userssecure tables.
Affected Software
Event History
Frequently Asked Questions
Who needs to act for this issue to be exploitable?
An attacker needs Layout Editor access to create a malicious layout_options field_id. After that payload is stored, any authenticated low-privilege user can trigger the vulnerable patient search path.
What data can be exposed?
The stored SQL injection can be used to exfiltrate data from the patient_data and users_secure tables.
Are unauthenticated users affected?
The described exploitation requires authenticated users. The initial payload requires Layout Editor access, and exploitation by lower-privilege users still requires authentication.
Which versions are affected?
OpenEMR versions before 8.5.0 are affected.