CVE-2026-41258 OpenMRS: Stored Velocity SSTI to RCE via ConceptReferenceRange

Critical 9.1 Published Updated

A user with Manage Concepts privilege can execute arbitrary code via stored Velocity templates in concept reference ranges.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-41258?

CVE-2026-41258 is a critical code injection vulnerability in openmrs-core, published on 15 May 2026. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

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.

Weakness: CWE-94

Which versions are affected by CVE-2026-41258?

4 open source packages ship an affected version, including org.openmrs.api:openmrs-api.

PackageAffectedFixed in
org.openmrs.api:openmrs-api MavenFrom 2.7.02.7.9
org.openmrs.api:openmrs-api MavenFrom 2.7.02.7.9
org.openmrs.api:openmrs-api MavenFrom 2.8.02.8.6
org.openmrs.api:openmrs-api MavenFrom 2.8.02.8.6

How do I fix CVE-2026-41258?

Upgrade org.openmrs.api:openmrs-api to a fixed version for your release line: 2.7.9 or 2.8.6.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-41258 being exploited?

There is no known exploitation of CVE-2026-41258 in the wild and no public exploit code.

Sources

Also known as GHSA-xj4f-8jjg-vx4q.

Is CVE-2026-41258 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free