Skip to main content

OpenMRS Core EUVDEUVD-2026-30558

| CVE-2026-41258 CRITICAL
Code Injection (CWE-94)
2026-05-04 https://github.com/openmrs/openmrs-core GHSA-xj4f-8jjg-vx4q
9.1
CVSS 3.1 · Vendor: https://github.com/openmrs/openmrs-core
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate with Manage Concepts privilege
  2. Delivery
    Access concept management interface
  3. Exploit
    Inject Velocity SSTI payload in reference range criteria
  4. Install
    Persist malicious template to database
  5. C2
    Trigger observation validation against compromised concept
  6. Execute
    Execute arbitrary Java code as Tomcat process
  7. Impact
    Exfiltrate PHI or establish persistence

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a valid OpenMRS account with the 'Manage Concepts' privilege, which is explicitly defined in OpenMRS as 'Able to add/edit/delete concept entries' and is typically granted to clinical informatics staff, terminology coordinators, and implementation administrators who maintain the clinical concept dictionary. The privilege is not restricted to system administrators, and vendor documentation indicates multiple facility staff commonly hold this privilege in typical healthcare deployments. The attacker must have network access to the OpenMRS web interface (AV:N from CVSS vector) to authenticate and access concept management functionality. Exploitation does not require any non-default configuration (AC:L) - the vulnerable ConceptReferenceRangeUtility.evaluateCriteria() method is active by default when concept reference ranges are used for clinical validation. No user interaction is required beyond the initial privilege abuse (UI:N). However, practical impact depends on whether the facility actively uses concept reference range criteria for observation validation; if this feature is unused, the vulnerable code path may not execute despite being present. The changed scope (S:C) reflects privilege escalation from concept management to arbitrary code execution as the Tomcat JVM process, transcending the intended security boundary of the 'Manage Concepts' privilege.

Impact

CVSS 9.1 (Critical) reflects attack vector network (AV:N), low complexity (AC:L), high privileges required (PR:H), no user interaction (UI:N), and changed scope (S:C) with full confidentiality, integrity, and availability impact. However, real-world risk is significantly nuanced by the privilege prerequisite. The 'Manage Concepts' privilege is described by the vendor as a content-management function for clinical dictionary administration, routinely granted to non-administrative clinical informatics staff at healthcare facilities. This creates a realistic privilege escalation path from clinical data management to full application server compromise. The persistence mechanism (database-stored payload executing on every observation validation) is particularly dangerous in healthcare environments where common clinical measurements trigger frequent automatic validations across all system users and API integrations. Protected Health Information (PHI) exfiltration requires no additional OS-level access since patient data objects are directly exposed in the Velocity context. The CVSS vector's high privilege requirement (PR:H) may understate risk if 'Manage Concepts' is widely distributed within typical OpenMRS deployments. No EPSS score provided, no CISA KEV listing indicates targeted rather than widespread exploitation. Patch availability is confirmed with specific fix versions from vendor GitHub advisory. Attack automation is feasible post-authentication with concept management privilege. SSVC decision: exploitation not confirmed active, automatable within authenticated scope, technical impact total (arbitrary code execution as Tomcat process).

Exploit ScenarioDerived

A medical records coordinator with 'Manage Concepts' privilege (granted for maintaining the clinical terminology dictionary) authenticates to the OpenMRS administration interface and navigates to concept management. The attacker creates or modifies a concept for a frequently used laboratory test (e.g., blood glucose measurement) and injects a malicious Velocity template expression into the reference range criteria field, such as a payload that invokes Java Runtime.exec() to establish a reverse shell or exfiltrate the patient database. The payload persists in the concept_reference_range database table. Subsequently, every time any clinician, automated lab interface, or mobile health application validates an observation against this concept, the ConceptReferenceRangeUtility.evaluateCriteria() method automatically executes the injected template as the Tomcat application server process, granting the attacker persistent code execution without further authentication. The attacker can exfiltrate Protected Health Information directly through the exposed $patient and $obs context objects or escalate to full server compromise.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 04, 2026

Server-side template injection in OpenMRS Core allows authenticated users with 'Manage Concepts' privilege to execute arbitrary Java code by injecting malicious Apache Velocity templates into concept reference range criteria fields. The vulnerability stems from unsafe VelocityEngine initialization without sandbox restrictions (no SecureUberspector), enabling unrestricted Java reflection. Exploitation persists across all facility users whenever observations are validated against the compromised concept, creating a persistent remote code execution vector. Fixed in versions 2.7.9 and 2.8.6 via migration from Velocity to sandboxed Spring Expression Language (SpEL) with SimpleEvaluationContext. No active exploitation confirmed (not in CISA KEV), but proof-of-concept details available from researcher advisory at machinespirits.com.

RemediationAI

Upgrade immediately to OpenMRS Core version 2.7.9 (for 2.7.x branch) or 2.8.6 (for 2.8.x branch) which replace the vulnerable Apache Velocity template engine with sandboxed Spring Expression Language (SpEL) using SimpleEvaluationContext. Patch commit available at https://github.com/openmrs/openmrs-core/commit/8d1c193. If immediate upgrade is not feasible, restrict 'Manage Concepts' privilege to only essential trusted personnel and implement database-level audit logging on the concept_reference_range table to detect injection attempts. Audit existing ConceptReferenceRanges in the database for suspicious criteria strings containing Velocity template syntax such as dollar-sign variable references, method invocations, or Java class references (search for patterns like '$', '.class', '.getClass()', 'Runtime'). Note that restricting the privilege may disrupt normal clinical dictionary maintenance workflows, requiring operational coordination. Database auditing adds performance overhead proportional to concept modification frequency. No partial mitigation fully eliminates risk short of upgrading; workarounds only reduce attack surface.

Affected VersionsENISA

openmrs-core 2.7.0 < 2.7.9
openmrs-core 2.8.0 < 2.8.6

Affected Packages

maven org.openmrs.api:openmrs-api fix: 2.7.9, 2.8.6
euvd openmrs_core fix: 2.7.9, 2.8.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

OpenMRS Core's ConceptReferenceRangeUtility.evaluateCriteria() method uses Apache Velocity template engine to evaluate database-stored criteria strings for clinical concept validation. The VelocityEngine was initialized with only logging configuration, using the default UberspectImpl introspector which permits unrestricted Java reflection through template expressions. The Velocity context exposes live OpenMRS objects including Patient/Person instances, Obs (observation) objects, and the ConceptReferenceRangeUtility service layer reference, providing direct access to the full application API and patient health information. CWE-94 (Improper Control of Generation of Code) applies as user-controlled data from the concept_reference_range VARCHAR(65535) database field is directly evaluated as executable template code. The patch replaces Velocity with Spring Expression Language (SpEL) using SimpleEvaluationContext with DataBindingPropertyAccessor (read-only), MapAccessor, and DataBindingMethodResolver, which restricts reflection capabilities and prevents arbitrary class instantiation. Expression parsing is cached via Caffeine cache with 20,000 entry maximum and 5-minute expiration to maintain performance.

Know when Java gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/openmrs/openmrs-core) PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/openmrs/openmrs-core) · only source for this CVE.

CVSS VectorVendor: https://github.com/openmrs/openmrs-core

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

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.

Patches

This is fixed in 2.8.6 and 2.7.9 as well as future versions.

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/

Executive ViewAI

Why It Matters

OpenMRS Core versions prior to 2.7.9 and 2.8.6 contain a critical server-side template injection vulnerability that allows authenticated users with concept management privileges to execute arbitrary Java code on the server. This vulnerability persists across all facility users and observations, creating a facility-wide remote code execution risk that could compromise patient data integrity, clinical operations, and system availability.

Business Impact: Severe
Compensating Controls

Apply vendor patch. Until patching is complete, restrict 'Manage Concepts' privilege to a minimal set of trusted administrative accounts and implement network-level access controls to limit who can reach OpenMRS concept management interfaces.

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Very High

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy