/

CVE-2026-32123

Severity:

HIGH RISK

(7.7)

Authorization Bypass in OpenEMR

CVE-2026-32123

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Unauthorized Access to Sensitive Medical Records

Severity:

HIGH RISK

(7.7)

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 fails to correctly enforce sensitivity-based access controls for group encounters because it checks the wrong data source for sensitivity flags.

In affected versions, users who should be restricted from viewing sensitive encounter records (such as mental health sessions) can still access those group encounter details under certain conditions.

Affected context

This vulnerability affects OpenEMR deployments using group encounters with sensitivity classifications, such as mental health or other restricted medical records.

The weakness occurs in the access-control logic that evaluates whether a user is allowed to view an encounter: the system consults form_encounter for sensitivity flags, while group encounters actually store this information in form_groups_encounter.

As a result, group encounters with sensitivity set are handled as if they were not sensitive, whenever authorization checks rely on the incorrect table.

Exploit preconditions

  • Attack surface: Application user interface and APIs that display or return encounter data.
  • Required access: Valid OpenEMR account with permissions to view at least some patient encounters or group sessions.
  • Trigger point: Requesting access (via UI or API) to a group encounter that has been marked as sensitive in form_groups_encounter.
  • Why exploitation is possible: The authorization layer evaluates sensitivity only in form_encounter, so the sensitivity flags for group encounters are never consulted, causing the checks to silently pass.

Why this happens

The root cause is an incomplete authorization implementation where the system performs sensitivity checks against an incorrect or partial data source.

Specifically, the access-control logic assumes sensitivity metadata is stored in the form_encounter table, but group encounters use form_groups_encounter to persist sensitivity information.

This mismatch creates an authorization gap consistent with CWE-863: Incorrect Authorization, where the system attempts to enforce access control but fails to consult all relevant attributes and resources needed to make a correct decision.

Conceptually, the bug reflects a design pattern where authorization logic is hardcoded to one data model and not updated when new encounter types or storage patterns are introduced.

Potential impact

  • Exposure of sensitive group encounter details (e.g., mental health or other restricted-session notes) to users who should be denied access.
  • Violation of patient privacy and potential non-compliance with healthcare regulations and data protection laws.
  • Unintended disclosure of diagnoses, treatments, or participation in sensitive group programs.
  • Erosion of trust between patients and providers due to improper handling of confidential information.

General mitigation guidance

Effective mitigation focuses on aligning authorization logic with the complete data model and treating sensitivity as a first-class access-control attribute:

  • Centralize sensitivity and authorization checks in a single, reusable access-control layer that understands all encounter types, including individual and group encounters.
  • Ensure sensitivity flags and other access-control attributes are consistently stored and retrieved from the correct tables or domain models for each encounter type.
  • Implement policy-based access control, where rules derive from patient privacy policies and roles, rather than relying on scattered checks across UI components.
  • Apply the principle of least privilege so that user roles only grant access to sensitive encounters when explicitly required.
  • Include regression tests for all encounter types (individual, group, telehealth, etc.) to verify that sensitivity and privacy rules are enforced uniformly.

How teams detect issues like this

Organizations can identify similar authorization gaps through:

  • Code review: Look for access-control logic that references only one table or encounter type when multiple variants exist; verify that sensitivity and privacy flags are consulted for each path that returns encounter data.
  • Static analysis: Configure rules to detect duplicated or inconsistent authorization checks across controllers, APIs, and views, especially for high-value resources like medical records.
  • Access-control testing: Perform role-based and privacy-focused test cases that attempt to view sensitive and non-sensitive encounters, including group encounters, confirming that restricted data is not returned.
  • Audit logging review: Examine logs for patterns where users with restricted roles frequently access sensitive group encounters, which may indicate an authorization oversight.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-j4mm-wg7q-v57q

Frequently asked

questions

Yes. Any authenticated user who can access the OpenEMR interface or API and has permission to view some encounters can, under affected configurations, access sensitive group encounters that should be restricted.

An attacker needs a valid OpenEMR account with at least basic rights to view encounter or group session data. They do not need elevated database or server access; the issue arises from the application's own authorization logic.

The safest pattern is to centralize and standardize authorization checks so they always:

  • Use a unified API to evaluate sensitivity and privacy attributes.
  • Query the correct data source for each encounter type (individual vs. group).
  • Enforce deny-by-default behavior when sensitivity information is missing or ambiguous.

Prevention typically involves:

  • Designing access control as a dedicated service or layer that understands all domain entities and their variants.
  • Requiring new encounter types or modules to declare how sensitivity and privacy are evaluated before they are integrated.
  • Maintaining automated tests and security reviews focused on privacy properties, especially for healthcare or regulated data.
Find out what's already
exploitable in your codebase.