OpenMRS
cpe:2.3:a:openmrs:openmrs:*:*:*:*:*:*:*
- >= 2.7.0, < 2.7.9
- >= 2.8.0, < 2.8.6
A critical vulnerability exists in OpenMRS versions 2.7.0 prior to 2.7.9 and 2.8.0 prior to 2.8.6. The issue arises in the ConceptReferenceRangeUtility.evaluateCriteria() method, which processes database-stored criteria strings as Apache Velocity templates without proper sandboxing. The VelocityEngine is configured only for logging, lacking a SecureUberspector, and allowing unrestricted Java reflection through template expressions. Users with the Manage Concepts privilege can inject malicious Velocity template expressions into a concept's reference range criteria. These payloads are executed automatically when validating observations against the affected concept, exposing patient data and potentially leading to arbitrary code execution on the server.
Exploitation of this vulnerability allows for persistent remote code execution on the server, with the injected payload executed in the context of the Tomcat application server process. The vulnerability also facilitates privilege escalation, as the Manage Concepts privilege is typically held by non-admin staff, and direct access to patient data is available through the Velocity context objects.
Users should update to OpenMRS versions 2.7.9 or 2.8.6. It is also recommended to restrict the Manage Concepts privilege to authorized users and audit ConceptReferenceRanges in the database.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.