/

CVE-2025-67645

Severity:

HIGH RISK

(8.8)

Broken Access Control in OpenEMR Profile Edit Endpoint

CVE-2025-67645

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-284

Impact:

Horizontal privilege escalation and potential 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 versions prior to 7.0.4 contain a broken access control flaw in the Profile Edit endpoint that allows a normal authenticated user to edit another user's profile data by tampering with ID parameters.

By changing the pubpid or pid values in the request, an attacker can update another user's personal and account-related information, which can lead to unauthorized data modification and potential account takeover scenarios.

Affected context

This vulnerability occurs in OpenEMR's web-based user management and profile functionality, specifically in the endpoint that handles profile editing.

It manifests when the backend logic trusts client-supplied identifiers (pubpid / pid) to determine which profile to update, without robust server-side verification that the current user is authorized to modify the targeted record.

The issue affects deployments where standard user accounts can access the profile edit feature and where multi-user environments (clinicians, staff, or patients) share the same OpenEMR instance.

Exploit preconditions

  • Attack surface: HTTP(S) Profile Edit endpoint exposed through the OpenEMR web interface.
  • Required access: Valid, authenticated user account with permission to edit their own profile.
  • Attacker capabilities: Ability to intercept and modify HTTP requests (e.g., browser dev tools, proxy) to change pubpid / pid parameters to another user's identifiers.
  • Trigger point: Submission of a crafted profile update request where the IDs point to a different user's profile.
  • Why exploitation is possible: The server-side handler applies changes solely based on the supplied IDs and does not consistently enforce ownership or authorization checks for the requested profile.

Why this happens

The root cause aligns with CWE-284: Improper Access Control.

The server-side implementation of the Profile Edit endpoint relies on client-provided identifiers (pubpid / pid) to determine which user record to modify, and fails to verify that the authenticated user is allowed to update that specific record.

This broken access control pattern is a classic horizontal privilege escalation issue: a user with legitimate privileges on their own record can extend those privileges to peer accounts by manipulating identifiers.

Conceptually, the flaw stems from binding authorization to user intent (what they submit) rather than to server-enforced ownership relationships and role-based checks.

Potential impact

  • Unauthorized modification of another user's profile details (name, contact information, demographic data).
  • Corruption of user account metadata that may be used for identity verification or notifications.
  • Facilitation of account takeover, for example by altering contact or recovery-related fields if downstream workflows rely on them.
  • Undermining of audit trails and user accountability when profile attributes are changed by other users.
  • Privacy and compliance risks in healthcare environments due to inaccurate or tampered user records.

General mitigation guidance

Effective mitigation focuses on enforcing server-side authorization checks for every operation that references a user or patient identifier.

Recommended patterns include:

  • Binding profile operations to the authenticated principal on the server side, ignoring any client-supplied identifiers for ownership decisions where possible.
  • When IDs must be passed from the client, enforcing strict authorization checks that confirm the current user is permitted to access and modify the targeted record (e.g., based on user ID equality or well-defined role/relationship rules).
  • Implementing a consistent access control layer or middleware that centralizes permission checks for all CRUD operations on user and patient entities.
  • Using least-privilege principles: regular users can only modify their own profile, while administrative roles have clearly scoped and audited capabilities.
  • Minimizing the exposure of internal identifiers and avoiding reliance on modifiable parameters for sensitive operations when a secure server-side mapping is available.

How teams detect issues like this

Detection typically combines code inspection and behavioral testing:

  • Static analysis and code review:
  • Search for handlers that update user or patient records based on client-supplied pid, pubpid, or similar IDs.
  • Flag code paths where no explicit ownership or role-based check is performed before applying changes.
  • Review controller and service methods for patterns where authorization is assumed but not enforced server-side.
  • Dynamic and security testing:
  • Use authorization testing in QA (e.g., "horizontal privilege escalation" test cases) where one user attempts to access or modify another user's data by changing identifiers.
  • Integrate automated tests or security scanners that systematically fuzz ID parameters in authenticated requests.
  • Policy and monitoring:
  • Establish development policies that require explicit authorization checks for any endpoint that accepts entity IDs.
  • Monitor application logs for suspicious patterns such as frequent edits across many different user IDs from a single account.

Sources

SourceLink
github.comgithub.com/openemr/openemr/commit/e2a682ee71aac71a9f04ae566f4ffca10052bc4a
github.comgithub.com/openemr/openemr/security/advisories/GHSA-vjmv-cf46-gffv

Frequently asked

questions

Yes. Any user who can log into the OpenEMR web interface and access the profile edit functionality can exploit this over the network by modifying request parameters, without needing local server access.

No. A normal, non-administrative authenticated user account is sufficient, as the flaw resides in how the application authorizes profile changes, not in special administrative features.

The most robust fix is to enforce server-side authorization logic that binds profile updates to the authenticated user's identity, ignoring or strictly validating any client-supplied IDs and ensuring only authorized principals can modify a given record.

Adopt a centralized authorization model, require explicit checks for every resource access, treat all client-supplied identifiers as untrusted, and incorporate authorization-focused test cases and automated reviews into the development and CI/CD process.

Find out what's already
exploitable in your codebase.