/

CVE-2026-33914

Severity:

HIGH RISK

(7.2)

SQL Injection in OpenEMR PostCalendar categoriesUpdate

CVE-2026-33914

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Manipulation and Data Integrity Compromise

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

A blind SQL injection vulnerability in OpenEMR's PostCalendar module allows unsanitized user input from the dels POST parameter to be directly interpolated into a DELETE statement.

Under conditions where an attacker can reach the categoriesUpdate administrative function, this flaw can be abused to manipulate or delete database records without authorization, potentially impacting the integrity of medical practice data.

Affected context

This vulnerability occurs in the PostCalendar module of OpenEMR within the categoriesUpdate administrative function.

The dels POST parameter is accepted from user input, passed through pnVarCleanFromInput() (which removes HTML tags but does not escape SQL metacharacters), and then concatenated into a raw SQL DELETE statement.

Deployments where the PostCalendar administration interface is exposed to authenticated users with category-management permissions are primarily affected, especially when those accounts may be phished, misused, or otherwise controlled by an attacker.

Exploit preconditions

  • Attack surface: HTTP POST requests to the PostCalendar administrative endpoint handling categoriesUpdate.
  • Required access: Ability to invoke the administrative function that processes the dels parameter (typically an authenticated admin or elevated role; in weakly configured environments this may extend to broader user groups).
  • Trigger point: Submission of a crafted dels POST parameter value that is incorporated into the SQL DELETE statement.
  • Why exploitation is possible: Input validation only strips HTML tags and does not perform SQL escaping or parameterization. The untrusted dels value is concatenated directly into a SQL query passed to Doctrine DBAL's executeStatement(), allowing an attacker to alter the structure or logic of the query.

Why this happens

The root cause is classical SQL injection due to dynamic query construction with untrusted input.

The dels POST parameter is sanitized with pnVarCleanFromInput(), which focuses on removing HTML content and provides no protection against SQL metacharacters such as quotes, operators, or comment delimiters.

This untrusted value is inserted directly into a SQL DELETE statement string and executed via Doctrine DBAL without using prepared statements or parameter binding.

This matches CWE-89: SQL Injection, where an application constructs SQL commands by concatenating user input instead of treating it as data.

Potential impact

  • Deletion of calendar category records that the application would not ordinarily allow the user to remove.
  • Broader manipulation of database contents if the injected SQL can extend beyond the intended DELETE statement.
  • Loss of integrity and availability of scheduling or calendar-related data.
  • Potential pivot to exfiltrate or tamper with additional data, depending on database permissions and query structure.
  • Disruption of medical practice workflows that rely on accurate scheduling and category data.

General mitigation guidance

Mitigation strategies center on eliminating string-built SQL and enforcing strict data/command separation:

  • Replace raw SQL concatenation with prepared statements and parameterized queries provided by the database abstraction layer.
  • Ensure any input used in SQL clauses is passed as bound parameters rather than interpolated into query strings.
  • Treat all external input (including administrative fields) as untrusted and subject to the same rigorous validation rules.
  • Implement server-side validation that constrains dels and similar parameters to expected formats (e.g., numeric IDs, fixed-length tokens, or whitelisted values).
  • Adopt a secure-by-default database access pattern across the codebase, discouraging direct string-based query construction in favor of ORM/DBAL query builders.

How teams detect issues like this

Detecting this class of issue generally involves a combination of review and automated checks:

  • Use static analysis rules to flag direct concatenation of HTTP parameters or other untrusted inputs into SQL strings, especially near executeStatement() and similar APIs.
  • During code review, look for:
  • Calls to sanitization functions that only target HTML or XSS while the data is later used in SQL.
  • Raw SQL strings containing interpolated variables (e.g., string concatenation or string formatting).
  • Bypassed or inconsistent use of ORM/DBAL parameter binding.
  • Apply application security testing (e.g., DAST) specifically targeting endpoints that perform administrative actions or deletions, and monitor for database error patterns or response-time anomalies indicative of blind SQL injection.
  • Integrate secure coding guidelines and linters into CI pipelines to enforce parameterized query usage as a policy.

Sources

SourceLink
github.comgithub.com/openemr/openemr/commit/1b851fc9af84f181ad7a84210a168d0d568cd442
github.comgithub.com/openemr/openemr/releases/tag/v8_0_0_3
github.comgithub.com/openemr/openemr/security/advisories/GHSA-rq3v-38x5-3rm5

Frequently asked

questions

Yes, it can be exploited remotely via HTTP requests, provided the attacker can reach and invoke the PostCalendar administrative categoriesUpdate endpoint that processes the dels parameter.

In typical deployments, access requires an authenticated user with permissions to manage PostCalendar categories (often an admin or privileged staff role). However, the practical impact depends on how tightly these permissions are controlled and whether such accounts can be compromised.

The most robust fix is to replace all string-concatenated SQL in the affected path with parameterized queries, passing the dels value (and similar inputs) as bound parameters through the database abstraction layer rather than interpolating it into SQL strings.

Standardize on ORM/DBAL query builders and prepared statements, treat every external input as untrusted (including admin-facing fields), enforce strict server-side validation and typing for all query-bound values, and incorporate automated static analysis and secure code review practices focused on identifying raw SQL construction.

Find out what's already
exploitable in your codebase.