/

CVE-2026-126478

Severity:

HIGH RISK

(7.6)

SQL Injection (CWE-89) in OpenEMR Surveillance Report

CVE-2026-126478

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Patient health information disclosure through database query manipulation

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenEMR's Syndromic Surveillance report has an SQL injection flaw involving values submitted in the form_icd_codes[] POST array. An authenticated user may be able to manipulate database queries and expose patient health information when those values are included in a numeric IN() clause without integer validation.

Affected context

The issue affects the Syndromic Surveillance report in OpenEMR versions before 8.5.0. It becomes a risk when the report processes the form_icd_codes[] POST array and concatenates its values into an SQL IN() clause without validating that they are integers.

Exploit preconditions

  • Attack surface: The Syndromic Surveillance report in the OpenEMR web application
  • Required access: An authenticated account able to submit the report form
  • Trigger point: Processing of values supplied through the form_icd_codes[] POST array
  • Why exploitation is possible: Values are inserted into an unquoted numeric IN() clause without integer validation; quote-free input may bypass escaping that does not enforce numeric types.

Why this happens

The application builds an SQL query by concatenating user-controlled array values into a numeric IN() clause without first restricting them to integers. Escaping alone does not establish that input is a valid number or safe to concatenate into SQL. This is an instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • An attacker may be able to alter the behavior of database queries.
  • Blind or UNION-based injection could expose patient health information.
  • Unauthorized access to data returned by affected queries could compromise patient privacy.

General mitigation guidance

Common defensive patterns include:

  • Use parameterized queries or prepared statements rather than building SQL with string concatenation.
  • Validate every submitted code as an integer and reject values that do not match the expected type and range.
  • Treat web form data as untrusted, even when it is expected to contain numeric values.
  • Apply least-privilege database permissions so the application account can access only the data and operations it needs.

How teams detect issues like this

Review query-building code for concatenation of request parameters, especially values placed in numeric IN() clauses. Use static analysis rules to flag SQL assembled from user-controlled input and check that database calls use parameterized statements. Code review and automated policy checks can verify that validation is enforced at the boundary and that escaping is not being used as a substitute for parameterization.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-q6f8-4pm7-q39r
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-sql-injection-via-form-icd-codes-in-syndromic-surveillance

Frequently asked

questions

Exploitation requires an authenticated user who can submit the Syndromic Surveillance report form.

The vulnerable input is the form_icd_codes[] POST array, whose values are concatenated into a numeric SQL IN() clause without integer validation.

Use parameterized queries and validate submitted codes as integers before processing them.

Treat all request data as untrusted, avoid constructing SQL through concatenation, and use code review or automated checks to enforce parameterized database access.

Find out what's already
exploitable in your codebase.