Severity by source
AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
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/
AnalysisAI
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.
Technical ContextAI
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.
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.
Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m
Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti
Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent
Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug
JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up
Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
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
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow
Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla
The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during
Same weakness CWE-94 – Code Injection
View allSame technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-30558
GHSA-xj4f-8jjg-vx4q