{"id":"CVE-2026-41258","aliases":["CVE-2026-41258","GHSA-xj4f-8jjg-vx4q"],"related":[],"kind":"vulnerability","state":"published","title":"OpenMRS: Stored Velocity SSTI to RCE via ConceptReferenceRange","summary":"OpenMRS is an open source electronic medical record system platform. From 2.7.0 to before 2.7.9 and 2.8.6, the ConceptReferenceRangeUtility.evaluateCriteria() method in OpenMRS Core evaluates database-stored criteria strings as Apache Velocity templates without any sandbox configuration. The VelocityEngine is initialized with only logging properties and noSecureUberspector, leaving the default UberspectImpl in place, which allows unrestricted Java reflection through template expressions. A user with the Manage Concepts privilege can store a malicious Velocity template expression in a concept's reference range criteria field. This payload is then executed automatically whenever a user or API call validates an observation against the affected concept. The Velocity context exposes $patient (the Person / Patient object), $obs (the Obs object), and $fn (the ConceptReferenceRangeUtility instance with access to the full OpenMRS service layer). This vulnerability is fixed in 2.7.9 and 2.8.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenMRS is an open source electronic medical record system platform. From 2.7.0 to before 2.7.9 and 2.8.6, the ConceptReferenceRangeUtility.evaluateCriteria() method in OpenMRS Core evaluates database-stored criteria strings as Apache Velocity templates without any sandbox configuration. The VelocityEngine is initialized with only logging properties and noSecureUberspector, leaving the default UberspectImpl in place, which allows unrestricted Java reflection through template expressions. A user with the Manage Concepts privilege can store a malicious Velocity template expression in a concept's reference range criteria field. This payload is then executed automatically whenever a user or API call validates an observation against the affected concept. The Velocity context exposes $patient (the Person / Patient object), $obs (the Obs object), and $fn (the ConceptReferenceRangeUtility instance with access to the full OpenMRS service layer). This vulnerability is fixed in 2.7.9 and 2.8.6.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThe `ConceptReferenceRangeUtility.evaluateCriteria()` method in OpenMRS Core\nevaluates database-stored criteria strings as Apache Velocity templates without any sandbox configuration. The `VelocityEngine` is initialized with only logging properties and no`SecureUberspector`, leaving the default `UberspectImpl` in place, which allows\nunrestricted Java reflection through template expressions.\n\nA user with the `Manage Concepts` privilege can store a malicious Velocity template\nexpression in a concept's reference range criteria field. This payload is then executed\nautomatically whenever a user or API call validates an observation against the affected\nconcept. The Velocity context exposes `$patient` (the `Person` / `Patient` object), `$obs` (the `Obs` object), and `$fn` (the `ConceptReferenceRangeUtility` instance with access to the full OpenMRS service layer).\n\n**Persistent Remote Code Execution**: The payload persists in the concept_reference_range database table (VARCHAR 65535). A single compromised concept for a common clinical measurement executes the payload on every subsequent observation validation across all users, API clients, and integrations in the facility.\n\n**Privilege Escalation**: The Manage Concepts privilege is a content-management function, defined as \"Able to add/edit/delete concept entries\", not an administrative privilege. Multiple non-admin staff per facility typically hold this privilege. The attacker escalates from concept dictionary management to arbitrary code execution as the Tomcat application server process.\n\n**PHI Exfiltration**: The Velocity context objects directly expose patient data without requiring OS-level RCE.\n\n### Patches\n\nThis is fixed in 2.8.6 and 2.7.9 as well as future versions.\n\n### Workarounds\n\nEnsure the `Manage Concepts` privilege is restricted to only authorized users and carefully audit any `ConceptReferenceRanges` in the database.\n\n### Resources\nhttps://github.com/openmrs/openmrs-core/commit/8d1c193\nhttps://www.machinespirits.com/advisory/1e8430/","format":"markdown","source":"ghsa"},{"lang":"es","text":"OpenMRS es una plataforma de sistema de registro médico electrónico de código abierto. Desde la 2.7.0 hasta antes de la 2.7.9 y la 2.8.6, el método ConceptReferenceRangeUtility.evaluateCriteria() en OpenMRS Core evalúa cadenas de criterios almacenadas en la base de datos como plantillas de Apache Velocity sin ninguna configuración de sandbox. El VelocityEngine se inicializa solo con propiedades de registro y noSecureUberspector, dejando el UberspectImpl predeterminado en su lugar, lo que permite la reflexión Java sin restricciones a través de expresiones de plantilla. Un usuario con el privilegio Gestionar Conceptos puede almacenar una expresión de plantilla Velocity maliciosa en el campo de criterios de rango de referencia de un concepto. Esta carga útil se ejecuta automáticamente cada vez que un usuario o una llamada a la API valida una observación contra el concepto afectado. El contexto de Velocity expone $patient (el objeto Persona / Paciente), $obs (el objeto Obs) y $fn (la instancia de ConceptReferenceRangeUtility con acceso a la capa de servicio completa de OpenMRS). Esta vulnerabilidad se corrige en las versiones 2.7.9 y 2.8.6.","source":"nvd"}],"published":"2026-05-04T19:31:22.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":">= 2.7.0 < 2.7.9","status":"affected"},{"version":">= 2.8.0 < 2.8.6","status":"affected"}],"vendor":"openmrs","product":"openmrs-core","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.9"}],"ecosystem":"Maven","package":"org.openmrs.api:openmrs-api","purl":"pkg:maven/org.openmrs.api/openmrs-api","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.6"}],"ecosystem":"Maven","package":"org.openmrs.api:openmrs-api","purl":"pkg:maven/org.openmrs.api/openmrs-api","source":"ghsa"}],"references":[{"url":"https://github.com/openmrs/openmrs-core/security/advisories/GHSA-xj4f-8jjg-vx4q","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41258","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/openmrs/openmrs-core/commit/8d1c193","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/openmrs/openmrs-core","tags":["package"],"sources":["ghsa"]},{"url":"https://www.machinespirits.com/advisory/1e8430","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-05-15T16:39:58.631Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41258","url":"https://www.cve.org/CVERecord?id=CVE-2026-41258","licence":"CVE Terms of Use","modified":"2026-05-15T16:40:36.115Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xj4f-8jjg-vx4q","url":"https://github.com/advisories/GHSA-xj4f-8jjg-vx4q","licence":"CC-BY-4.0","modified":"2026-05-16T00:10:46.998Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41258","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41258","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.820Z","epss":{"score":0.00317,"percentile":0.2659,"date":"2026-12-02T12:00:21.000Z"}}