Summary
Workarounds
Ensure the Manage Concepts privilege is restricted to only authorized users and carefully audit any ConceptReferenceRanges in the database.
Resources
https://github.com/openmrs/openmrs-core/commit/8d1c193
https://www.machinespirits.com/advisory/1e8430/
Impact
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).
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.
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.
PHI Exfiltration: The Velocity context objects directly expose patient data without requiring OS-level RCE.
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
CVE-2026-41258 has a CVSS score of 9.1 (Critical). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.7.9, 2.8.6); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
This is fixed in 2.8.6 and 2.7.9 as well as future versions.
Frequently Asked Questions
- What is CVE-2026-41258? CVE-2026-41258 is a critical-severity code injection vulnerability in org.openmrs.api:openmrs-api (maven), affecting versions >= 2.7.0, < 2.7.9. It is fixed in 2.7.9, 2.8.6. Untrusted input is evaluated as executable code within the application's runtime environment.
- How severe is CVE-2026-41258? CVE-2026-41258 has a CVSS score of 9.1 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of org.openmrs.api:openmrs-api are affected by CVE-2026-41258? org.openmrs.api:openmrs-api (maven) versions >= 2.7.0, < 2.7.9 is affected.
- Is there a fix for CVE-2026-41258? Yes. CVE-2026-41258 is fixed in 2.7.9, 2.8.6. Upgrade to this version or later.
- Is CVE-2026-41258 exploitable, and should I be worried? Whether CVE-2026-41258 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-41258 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-41258?
- Upgrade
org.openmrs.api:openmrs-apito 2.7.9 or later - Upgrade
org.openmrs.api:openmrs-apito 2.8.6 or later
- Upgrade