Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsChecklistsAI RankingsNewsletterStatusTagsAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Checklists
AI Rankings
Newsletter
Status
Tags
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

1154+ Articles
126+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-41258: OpenMRS Velocity Template Injection Enables Remote Code Execution
CVE-2026-41258: OpenMRS Velocity Template Injection Enables Remote Code Execution

Critical Security Alert

This vulnerability is actively being exploited. Immediate action is recommended.

SECURITYCRITICALCVE-2026-41258

CVE-2026-41258: OpenMRS Velocity Template Injection Enables Remote Code Execution

A critical unsandboxed Apache Velocity template injection vulnerability in OpenMRS Core allows authenticated attackers to execute arbitrary code on the...

Dylan H.

Security Team

May 16, 2026
2 min read

Affected Products

  • OpenMRS Core 2.7.0 – 2.7.8, 2.8.0 – 2.8.5

Overview

A critical-severity remote code execution vulnerability has been disclosed in OpenMRS Core, the widely deployed open-source electronic medical record platform. The flaw, tracked as CVE-2026-41258 with a CVSS score of 9.1, stems from the evaluation of database-stored strings as unsandboxed Apache Velocity templates in the ConceptReferenceRangeUtility.evaluateCriteria() method.

Technical Details

The ConceptReferenceRangeUtility.evaluateCriteria() method retrieves criteria strings from the OpenMRS database and passes them directly to the Apache Velocity template engine without any sandbox configuration. This allows an attacker who can influence these database-stored criteria — through legitimate application features or a prior SQL injection — to inject and execute arbitrary Velocity template expressions on the server.

Apache Velocity templates have access to the JVM runtime environment by default when no SecureUberspector or similar sandbox is enforced. This makes it possible to chain template directives to spawn system processes, read files, or establish reverse shells.

Attack chain:

  1. Attacker gains access to modify concept reference range criteria (authenticated role or secondary injection)
  2. Malicious Velocity template directive inserted into the criteria string
  3. OpenMRS Core evaluates the stored string server-side via Velocity
  4. Arbitrary code executes with the privileges of the OpenMRS application server

Affected Versions

BranchAffected RangeFixed In
2.7.x2.7.0 – 2.7.82.7.9
2.8.x2.8.0 – 2.8.52.8.6

Versions prior to 2.7.0 may also be affected but have not been assessed.

Impact

OpenMRS is used extensively across low- and middle-income countries for hospital and clinic patient management, often handling sensitive protected health information (PHI). Successful exploitation could result in:

  • Full server compromise and lateral movement within the hospital network
  • Exfiltration of patient records including diagnoses, medications, and personally identifiable information
  • Ransomware deployment against healthcare infrastructure
  • Disruption of clinical operations

Remediation

Upgrade immediately to the patched releases:

  • OpenMRS Core 2.7.9 or later
  • OpenMRS Core 2.8.6 or later

If an immediate upgrade is not possible, consider the following mitigations:

  1. Restrict database-level write access to the concept reference range tables to trusted administrative accounts only
  2. Enable database auditing to detect unauthorized modifications to criteria strings
  3. Apply network segmentation to limit the attack surface around the OpenMRS application server
  4. Monitor application logs for unexpected Velocity template evaluation errors

References

  • NVD — CVE-2026-41258
  • OpenMRS Security Advisories
  • Apache Velocity Security Guidance
#CVE#OpenMRS#RCE#Template Injection#Healthcare#Critical

Related Articles

CVE-2026-32604: Spinnaker Clouddriver Remote Code Execution (CVSS 9.9)

A critical unauthenticated RCE vulnerability in Spinnaker's clouddriver service allows attackers to execute arbitrary commands on clouddriver pods,...

2 min read

CVE-2026-32613: Spinnaker Echo Spring Expression Language Injection (CVSS 9.9)

A critical code injection flaw in Spinnaker's Echo service allows unrestricted Spring Expression Language (SPeL) execution via artifact processing,...

4 min read

CVE-2026-39918: Vvveb CMS Unauthenticated PHP Code Injection via Install Endpoint

Vvveb CMS versions prior to 1.0.8.1 allow unauthenticated attackers to inject arbitrary PHP code through the installation endpoint's unsanitized subdir...

4 min read
Back to all Security Alerts