/

CVE-2026-49142

Severity:

HIGH RISK

(8.8)

SQL Injection (CWE-89) in OpenEMR Syndromic Module

CVE-2026-49142

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary Database Read/Write and Account Takeover

Severity:

HIGH RISK

(8.8)

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 contains an authenticated SQL injection vulnerability in the Syndromic Surveillance module, where crafted form input can alter database queries. A user with Clinician-level privileges may read or modify arbitrary database contents, potentially enabling password resets and administrative account takeover.

OpenEMR contains an authenticated SQL injection vulnerability in the Syndromic Surveillance module, where crafted form input can alter database queries. A user with Clinician-level privileges may read or modify arbitrary database contents, potentially enabling password resets and administrative account takeover.

Affected context

The vulnerability occurs in OpenEMR deployments using the Syndromic Surveillance module when values submitted through the form_icd_codes[] parameter reach the syndromicsurveillance/index endpoint without being safely separated from SQL syntax. Exploitation generally depends on an authenticated account with Clinician-level privileges and database connectivity from the application.

The vulnerability occurs in OpenEMR deployments using the Syndromic Surveillance module when values submitted through the form_icd_codes[] parameter reach the syndromicsurveillance/index endpoint without being safely separated from SQL syntax. Exploitation generally depends on an authenticated account with Clinician-level privileges and database connectivity from the application.

Exploit preconditions

  • Attack surface: Authenticated HTTP requests to the Syndromic Surveillance module
  • Required access: A valid account with Clinician-level privileges or equivalent access
  • Trigger point: Processing of submitted form_icd_codes[] values by the surveillance endpoint
  • Why exploitation is possible: User-controlled values are incorporated into database query logic without reliable parameterization, allowing query structure and execution behavior to be altered
  • Attack surface: Authenticated HTTP requests to the Syndromic Surveillance module
  • Required access: A valid account with Clinician-level privileges or equivalent access
  • Trigger point: Processing of submitted form_icd_codes[] values by the surveillance endpoint
  • Why exploitation is possible: User-controlled values are incorporated into database query logic without reliable parameterization, allowing query structure and execution behavior to be altered

Why this happens

The underlying flaw is SQL injection caused by constructing or executing database queries with untrusted input embedded in SQL expressions. Numeric values used in an IN() clause are not sufficiently isolated from query syntax, allowing injected query fragments to influence database operations. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, and may also expose error-based database behavior when database functions return query-derived information.

The underlying flaw is SQL injection caused by constructing or executing database queries with untrusted input embedded in SQL expressions. Numeric values used in an IN() clause are not sufficiently isolated from query syntax, allowing injected query fragments to influence database operations. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, and may also expose error-based database behavior when database functions return query-derived information.

Potential impact

  • Attackers may read arbitrary database records
  • Attackers could modify or delete application data
  • Password hashes and other sensitive authentication data may be exposed
  • User credentials may be reset or administrative accounts compromised
  • Patient, operational, or audit data may be altered
  • The application and connected database may suffer loss of integrity or availability
  • Attackers may read arbitrary database records
  • Attackers could modify or delete application data
  • Password hashes and other sensitive authentication data may be exposed
  • User credentials may be reset or administrative accounts compromised
  • Patient, operational, or audit data may be altered
  • The application and connected database may suffer loss of integrity or availability

General mitigation guidance

Mitigation generally focuses on preventing user input from becoming executable SQL.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for every dynamic database value
  • Validate numeric inputs with strict allowlists and reject unexpected formats
  • Avoid constructing IN() clauses through string concatenation; use database-driver parameter expansion
  • Apply consistent server-side validation before query construction
  • Limit database accounts to the minimum permissions required by the application
  • Separate administrative password-reset capabilities from ordinary clinical workflows
  • Reduce trust in client-controlled form fields and enforce authorization at the endpoint

Mitigation generally focuses on preventing user input from becoming executable SQL.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for every dynamic database value
  • Validate numeric inputs with strict allowlists and reject unexpected formats
  • Avoid constructing IN() clauses through string concatenation; use database-driver parameter expansion
  • Apply consistent server-side validation before query construction
  • Limit database accounts to the minimum permissions required by the application
  • Separate administrative password-reset capabilities from ordinary clinical workflows
  • Reduce trust in client-controlled form fields and enforce authorization at the endpoint

How teams detect issues like this

Organizations can look for SQL injection risks through:

  • Static analysis rules identifying string concatenation or interpolation in SQL execution paths
  • Code review checks for dynamic IN() clauses and database queries built from request parameters
  • Runtime monitoring for abnormal database errors, unexpected UNION-like query patterns, or unusual query volume
  • Web application firewall and API policy rules that inspect suspicious input while avoiding reliance on filtering alone
  • Database audit logs showing unexpected reads, writes, password changes, or access to authentication tables
  • Automated security testing that verifies parameterization and authorization boundaries in authenticated endpoints

Organizations can look for SQL injection risks through:

  • Static analysis rules identifying string concatenation or interpolation in SQL execution paths
  • Code review checks for dynamic IN() clauses and database queries built from request parameters
  • Runtime monitoring for abnormal database errors, unexpected UNION-like query patterns, or unusual query volume
  • Web application firewall and API policy rules that inspect suspicious input while avoiding reliance on filtering alone
  • Database audit logs showing unexpected reads, writes, password changes, or access to authentication tables
  • Automated security testing that verifies parameterization and authorization boundaries in authenticated endpoints

Sources

SourceLink
github.comgithub.com/openemr/openemr/commit/9b52cc0fc3a4eddd9fa7a096f6a3ac2a57d772d0
github.comgithub.com/openemr/openemr/pull/14329
github.comgithub.com/openemr/openemr/releases/tag/v8_5_0
github.comgithub.com/openemr/openemr/security/advisories/GHSA-w99c-jwcm-24hh
vulncheck.comvulncheck.com/advisories/openemr-before-sql-injection-via-form-icd-codes

Frequently asked

questions

It can be exploited through the application's HTTP interface when the attacker has valid credentials and access to the affected Syndromic Surveillance functionality.

The described attack requires an authenticated user with Clinician-level privileges or comparable permission to submit data to the vulnerable endpoint.

Use parameterized database queries, strictly validate numeric collections, and ensure authorization is enforced independently of client-controlled input.

Combine secure query APIs, focused code review, automated static analysis, least-privilege database permissions, and monitoring for anomalous database activity.

It can be exploited through the application's HTTP interface when the attacker has valid credentials and access to the affected Syndromic Surveillance functionality.

The described attack requires an authenticated user with Clinician-level privileges or comparable permission to submit data to the vulnerable endpoint.

Use parameterized database queries, strictly validate numeric collections, and ensure authorization is enforced independently of client-controlled input.

Combine secure query APIs, focused code review, automated static analysis, least-privilege database permissions, and monitoring for anomalous database activity.

Find out what's already
exploitable in your codebase.