---
id: CVE-2026-126491
title: >-
  OpenEMR before 8.5.0 SQL Injection via getByPatientDemographics in
  patient.inc.php
summary: >-
  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 …
severity: high
cvss: 7.6
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:N'
cvssSource: cna
cwe:
  - CWE-89
vendor: openemr
product: openemr
affected:
  - openemr < 8.5.0
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-11-17T13:57:19.064980Z'
exploitAvailable: true
published: '2026-11-13'
updated: '2026-11-17'
sourceUpdated: '2026-11-17T13:59:34.539Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-126491'
references:
  - url: 'https://github.com/openemr/openemr/security/advisories/GHSA-pc2q-9pcw-v899'
    label: GitHub Security Advisory (GHSA-pc2q-9pcw-v899)
  - url: >-
      https://www.vulncheck.com/advisories/openemr-before-8.5.0-sql-injection-via-getbypatientdemographics-in-patient-inc-php
    label: >-
      VulnCheck Advisory: OpenEMR before 8.5.0 SQL Injection via
      getByPatientDemographics in patient.inc.php
tags:
  - cve.org
  - exploit-available
epss: 0.00302
epssPercentile: 0.23055
ingestedAt: '2026-11-13T10:36:39.598Z'
---

## Overview

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.

## Affected

- `openemr < 8.5.0`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
