Code InjectionWeakness · CWE-94

CVE-2026-41258

CRITICAL · 9.1 CVSS v3.1 Published 2026-05-15
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
97/100
Remediation priority · Urgent
Remotely reachable Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

OpenMRS Core versions 2.7.0-2.7.8 and 2.8.0-2.8.5 contain an SSTI vulnerability where ConceptReferenceRangeUtility.evaluateCriteria() evaluates Velocity templates without sandboxing, allowing RCE via unsafe reflection through exposed $fn service layer access. Attackers with Manage Concepts privilege inject malicious templates into concept reference range criteria fields.

MitigationUpgrade immediately to version 2.7.9 or 2.8.6. Until patched, revoke 'Manage Concepts' privilege from untrusted users and audit existing concepts for suspicious criteria values.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
High
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify OpenMRS Core version
    Check the OpenMRS application Administration page or the 'openmrs' WAR file version manifest. Alternatively, query the 'global_property' table for 'openmrs.version' or check the pom.xml of the deployed openmrs-core artifact.
    Affected if Installed version is 2.7.0 through 2.7.8, or 2.8.0 through 2.8.5
  2. Verify Manage Concepts privilege assignment
    Access the OpenMRS Administration > Manage Roles page. Review all roles that include the 'Manage Concepts' privilege. List all users assigned to those roles.
    Affected if Any user account other than trusted administrators holds the Manage Concepts privilege
  3. Inspect concept reference range criteria values
    Query the database table storing concept reference range data (typically 'concept_reference_range' or similar) or use OpenMRS > Administration > Concepts > View Concepts to review reference ranges. Examine the 'criteria' column/field for suspicious Velocity template syntax such as '$fn.', '#set', '#foreach', or '${'.
    Affected if Any concept reference range contains Velocity template language characters or expressions that resemble code injection

A user is affected if running OpenMRS Core versions 2.7.0-2.7.8 or 2.8.0-2.8.5 AND has the Manage Concepts privilege assigned to non-admin accounts, or if concept reference range criteria contain template injection patterns.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade immediately to version 2.7.9 or 2.8.6. Until patched, revoke 'Manage Concepts' privilege from untrusted users and audit existing concepts for suspicious criteria values.

Recommended fix High confidence

Upgrade to OpenMRS Core 2.7.9 (for 2.7.x branch) or 2.8.6 (for 2.8.x branch)

  1. 1. Identify the current OpenMRS Core version by checking the OpenMRS administration interface or the runtime properties file
  2. 2. Determine which version branch you are currently on (2.7.x or 2.8.x) to select the appropriate upgrade target
  3. 3. Create a complete backup of the OpenMRS database and application files before proceeding with any upgrade
  4. 4. Download the fixed release: upgrade to version 2.7.9 if on the 2.7.x branch, or upgrade to version 2.8.6 if on the 2.8.x branch
  5. 5. Deploy the new OpenMRS Core WAR file to your application server
  6. 6. Run any database migration scripts provided with the upgrade
  7. 7. Verify the upgrade was successful by logging into the administration interface
  8. 8. Confirm the vulnerability is remediated by testing that Velocity template expressions in concept reference range criteria are no longer executed as code
Caveat Review OpenMRS release notes for any breaking changes or module compatibility issues between your current version and the target fixed version

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-41258 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-41258 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data