/

CVE-2026-126489

Severity:

HIGH RISK

(7.2)

SQL Injection (CWE-89) in OpenEMR IPPF Issue Feature

CVE-2026-126489

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution with the application's database privileges

Severity:

HIGH RISK

(7.2)

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 IPPF contraceptive issue feature can form a SQL query using configurable field identifiers without safely restricting them. An authenticated administrator who can add a malicious identifier and trigger issue processing may cause arbitrary SQL to run with the application's database privileges.

Affected context

The vulnerability is in the IPPF contraceptive issue feature. The issue_ippf_con_save function builds a REPLACE INTO query using field_id values from layout_options as column names. The described issue affects OpenEMR versions before 8.5.0 when an administrator can modify those layout fields and the feature later processes them.

Exploit preconditions

  • Attack surface: OpenEMR's authenticated administrative interface and IPPF issue-processing flow
  • Required access: The ability to add or change a field_id through edit_layout.php; the described scenario involves an authenticated administrator
  • Trigger point: Processing an issue through add_edit_issue.php, which invokes issue_ippf_con_save
  • Why exploitation is possible: The configured identifier is incorporated into SQL as a column name without adequate restriction, allowing crafted configuration to alter the resulting query

Why this happens

The application concatenates a value from configurable layout data into a SQL statement as an identifier. SQL parameters generally bind data values, not column names, so dynamic identifiers require separate validation against a trusted set. Accepting an untrusted identifier in query construction creates a SQL injection flaw, corresponding to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Potential impact

  • An attacker could read, modify, or delete database data within the application's database permissions.
  • Application records or configuration could be altered, affecting data integrity.
  • Sensitive information stored in the database may be exposed.
  • The issue could disrupt application functionality or undermine trust in stored records.

General mitigation guidance

Defensive patterns focus on preventing untrusted input from becoming part of SQL syntax.

  • Use fixed, predefined column mappings rather than accepting arbitrary identifiers.
  • Validate dynamic identifiers against a strict allowlist derived from the expected schema.
  • Use parameterized queries for data values and safe, database-appropriate identifier handling where dynamic identifiers are unavoidable.
  • Restrict who can modify layout configuration and separate configuration privileges from routine feature use.
  • Apply least-privilege permissions to the database account so query impact is limited.

How teams detect issues like this

Review query-building code for string concatenation involving request data, configuration values, or database-sourced values, especially when used as table or column identifiers. Static analysis and code review can flag dynamic SQL construction and verify that identifiers are allowlisted rather than merely escaped. Policy checks can require parameterized queries for values and explicit validation for dynamic identifiers; automated code review tools may help surface these patterns.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-8j6v-q545-q9q7
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-sql-injection-via-ippf-contraceptive-issue-feature

Frequently asked

questions

It is exploitable through the application's authenticated feature flow, but the described scenario requires the ability to configure a malicious field identifier and then trigger issue processing.

The described attack requires an authenticated administrator who can modify layout fields. The exact access requirements depend on how administrative permissions are assigned in a deployment.

Avoid using configurable input as SQL syntax. Map accepted fields to a fixed set of identifiers, validate them against an allowlist, and parameterize data values.

Review all dynamic query construction, enforce validation at trust boundaries, limit configuration-editing privileges, and use database accounts with only the permissions the application needs.

Find out what's already
exploitable in your codebase.