Summary
Several OpenEMR scripts rely on session authentication without performing the required authorization checks. An authenticated low-privilege user may be able to access sensitive patient or provider data and forge chart-tracker records.
Affected context
The issue affects OpenEMR versions before 8.5.0 in several custom scripts: export_labworks.php, chart_tracker.php, and export_registry_xml.php. The risk arises when these endpoints accept an authenticated session but do not verify that the user is authorized to perform the requested action.
Exploit preconditions
- Attack surface: The affected OpenEMR scripts, when reachable through the application
- Required access: An authenticated account; the description indicates that low-privilege access may be sufficient
- Trigger point: A request to an affected export or chart-tracker script
- Why exploitation is possible: Session authentication establishes that a user is logged in, but does not enforce the authorization checks needed to restrict access to the requested data or operation
Why this happens
The scripts rely on session authentication without calling AclMain::aclCheckCore() to enforce authorization. This is a missing authorization control: the application verifies a user's identity but does not adequately check whether that user is permitted to access the data or modify the records involved. This behavior maps to CWE-862: Missing Authorization.
Potential impact
- An attacker may disclose patient SSNs, dates of birth, and insurance information
- An attacker could access provider NPI or tax ID information
- An attacker may forge chart-tracker records
- Unauthorized access or changes could undermine the confidentiality and integrity of health records
General mitigation guidance
Defensive approaches focus on enforcing authorization at every sensitive endpoint, rather than treating authentication as sufficient.
- Apply consistent, centralized access-control checks before returning data or making changes
- Follow least-privilege principles for users and roles
- Minimize sensitive information returned by exports, and limit access to necessary fields
- Validate authorization for the specific patient, provider, and operation involved
- Treat requests and session state as untrusted until access policy has been checked
How teams detect issues like this
- Review sensitive scripts for session checks that are not followed by resource- and action-level authorization checks
- Use static analysis or code review rules to identify endpoints missing calls to centralized access-control functions
- Test requests to export and record-modification endpoints using accounts with different roles and permissions
- Enforce policy checks in CI and security testing for endpoints that handle health or provider data

