Summary
OpenEMR contains a missing authorization check in procedure-order handling, allowing some authenticated users without patients/lab permission to access other patients' orders. Depending on the request, an attacker may disclose clinical history or alter diagnoses, instructions, and order status.
Affected context
The issue is in interface/forms/procedure_order/common.php in OpenEMR versions before 8.5.0. It may affect deployments where authenticated accounts that lack patients/lab permission can reach the procedure-order functionality and its patient or order records without adequate authorization checks.
Exploit preconditions
- Attack surface: OpenEMR procedure-order handling
- Required access: An authenticated account; the account may lack patients/lab permission
- Trigger point: A request that references a global order ID, or a
bn_saverequest made while the target patient is selected in the session - Why exploitation is possible: The application does not adequately verify that the account is authorized to access or modify the specified patient's procedure order
Why this happens
The underlying issue is a missing authorization check, mapped to CWE-862: Missing Authorization. The application processes requests for procedure orders without consistently confirming that the authenticated user has permission to access the relevant patient record and perform the requested action. Authentication alone does not establish authorization for each record or operation.
Potential impact
- An attacker may disclose clinical history associated with other patients' procedure orders.
- An attacker could falsify diagnoses or instructions.
- An attacker may alter procedure-order status, potentially affecting care workflows.
- Unauthorized changes could undermine the accuracy and integrity of patient records.
General mitigation guidance
Mitigations generally focus on enforcing authorization at every record and action boundary.
Common defensive patterns include:
- Checking the user's permissions for the specific patient and procedure order on every read and write.
- Deriving the authorized patient context from trusted server-side state rather than relying on request parameters alone.
- Applying secure-by-default access controls and denying operations when authorization cannot be established.
- Limiting account privileges to the minimum required for their role.
- Auditing and monitoring access to sensitive clinical records and changes to procedure orders.
How teams detect issues like this
Review procedure-order handlers for authorization checks that bind the authenticated user to the specific patient and requested action. Static analysis and code review can look for direct use of order identifiers or save operations without permission checks. Policy tests should verify that accounts without the relevant permission cannot read or modify another patient's records, including when patient context or identifiers are supplied through requests.

