OpenEMR SQL Injection Vulnerability in Patient Selection Feature

Vulnerability

A SQL injection vulnerability has been identified in OpenEMR versions through 8.0.0.2, specifically within the patient selection feature. This vulnerability allows authenticated attackers to exploit insufficient input validation, leading to the injection of malicious SQL code. The issue arises when database entries are directly concatenated into SQL queries without proper sanitization, creating an opportunity for attackers to manipulate the queries and potentially access or modify sensitive data.

Impact

Exploitation of this vulnerability allows for unauthorized SQL injection, which could lead to unauthorized access to database information, potential breaches of sensitive medical information, and in some cases, server-side code execution or database compromise.

Reproduction

To reproduce this vulnerability, an authenticated user can insert a payload into the 'layout_options' table using the 'edit_layout.php' interface. Once the payload is injected, the 'patient_select.php' script can be used to trigger the SQL injection by exploiting the injected payload through the 'getByPatientDemographics' function, which concatenates the payload into a SQL query without proper escaping.

Remediation

Users can upgrade to OpenEMR version 8.0.0.3, which includes a patch for this vulnerability.

Added: Mar 25, 2026, 11:24 PM
Updated: Mar 25, 2026, 11:24 PM

Vulnerability Rating

Custom Algorithm
spread
4.5
impact
3.1
exploitability
5.8
remediation
7.7
relevance
4.7
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.