/

CVE-2026-126480

Severity:

HIGH RISK

(8.1)

SQL Injection (CWE-89) in OpenEMR CcrTable Insert

CVE-2026-126480

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database access or modification

Severity:

HIGH RISK

(8.1)

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 a SQL injection vulnerability in CcrTable::insertApprovedData() where request parameter names are used as database column names. An authenticated user may be able to manipulate database queries through crafted parameters sent to the revandapprove route, potentially exposing or corrupting patient records.

Affected context

The issue affects OpenEMR deployments before 8.5.0 where the revandapprove route invokes CcrTable::insertApprovedData() with request parameters that can influence column names in a SQL statement. The described route lacks ACL and CSRF checks, which may weaken authorization and request-integrity protections.

Exploit preconditions

  • Attack surface: The revandapprove route and its handling of patient_data-*-sel request parameters
  • Required access: An authenticated OpenEMR account; the description does not specify a required privilege level
  • Trigger point: Processing a request that reaches CcrTable::insertApprovedData()
  • Why exploitation is possible: Parameter names are incorporated into SQL as column names without adequate protection, and the route is described as lacking ACL and CSRF checks

Why this happens

The underlying flaw is SQL injection caused by allowing request-controlled values to influence SQL identifiers. SQL parameters can safely bind data values, but generally cannot bind column names; identifiers must instead be selected from a strict, trusted allowlist. Treating untrusted parameter names as column names maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Potential impact

  • Attackers may be able to copy password hashes into patient fields
  • Patient records may be corrupted or altered
  • Sensitive database information may be exposed, depending on query behavior and database permissions
  • Data integrity and confidentiality may be affected

General mitigation guidance

Mitigation patterns focus on keeping request data out of SQL structure and enforcing authorization at the operation boundary.

  • Select column names only from a strict allowlist of expected identifiers
  • Use parameterized queries for all user-controlled data values
  • Validate request structure and reject unexpected parameter names
  • Apply authorization checks to sensitive routes and operations
  • Use CSRF protections for state-changing requests
  • Restrict database account permissions to the minimum needed

How teams detect issues like this

  • Use static analysis to identify SQL construction that incorporates request parameter names or other untrusted input
  • Review database calls for dynamically assembled table or column identifiers and verify that identifiers come from trusted allowlists
  • Check that sensitive routes enforce authorization and CSRF protections
  • Apply policy checks in code review and CI to flag unsafe SQL construction and missing route-level security controls
  • Monitor for unusual updates to patient fields and unexpected database query patterns

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-86hf-j825-r56h
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-sql-injection-via-ccr-revandapprove-parameter-names

Frequently asked

questions

The description identifies authenticated users as the attack source. The required privilege level is not specified.

Request parameter names can influence SQL column names, and the route is described as lacking ACL and CSRF checks.

Keep SQL identifiers out of request-controlled input by selecting columns from a strict allowlist, and bind data values with parameterized queries.

Review dynamic SQL construction, validate request structure, and consistently enforce authorization and CSRF protections on sensitive operations.

Find out what's already
exploitable in your codebase.