Summary
OpenEMR contains a missing authorization check in its authorizations component, allowing an authenticated staff user to mark clinical records belonging to arbitrary patients as authorized. This can bypass provider review when the affected authorization request is processed.
Affected context
The issue is in authorizations_full.php and affects OpenEMR versions before 8.5.0. It occurs when the authorization handler processes a request for a patient and records without adequately verifying that the authenticated staff user is permitted to authorize them.
Exploit preconditions
- Attack surface: The authenticated application endpoint handled by
authorizations_full.php - Required access: An authenticated staff account; the described behavior does not require provider-level authorization
- Trigger point: Processing a
mode=authorizerequest for a patient record - Why exploitation is possible: The handler accepts a patient identifier supplied by the requester without enforcing authorization for that patient and the affected records
Why this happens
The underlying bug is a missing server-side authorization check, mapped to CWE-862: Missing Authorization. The application processes an authenticated user's request to change record authorization state without adequately checking whether that user has permission to act on the specified patient's records. Authentication and CSRF validation do not replace object-level authorization.
Potential impact
- A staff user could authorize clinical records belonging to patients outside their permitted scope.
- Provider review requirements could be bypassed.
- Billing, forms, notes, or transaction records could be marked authorized without appropriate review.
- Unauthorized record-state changes could affect clinical or administrative workflows.
General mitigation guidance
Mitigations generally focus on enforcing authorization at the point where sensitive records are accessed or changed.
Common defensive patterns include:
- Verify the user's permission for the specific patient and record on every authorization request.
- Derive patient scope from trusted server-side authorization context rather than relying on a requester-supplied identifier.
- Apply consistent access-control checks across all affected record types and workflow actions.
- Use least-privilege roles and separate record review or approval responsibilities where appropriate.
- Treat CSRF protections as complementary to authorization checks, not as a substitute for them.
How teams detect issues like this
High-level review and monitoring can help identify missing object-level authorization:
- Review handlers that accept patient or record identifiers and change sensitive workflow state.
- Use static analysis or code review checks to flag state-changing endpoints without authorization checks tied to the requested object.
- Test access-control policies across users, roles, patients, and record types, including attempts to act outside a user's permitted scope.
- Monitor audit logs for authorization changes by users who lack the expected provider or patient-level permissions.
- Enforce policy checks in shared authorization middleware or service-layer methods so they are consistently applied.

