Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40076: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in openmrs openmrs-core

0
Critical
VulnerabilityCVE-2026-40076cvecve-2026-40076cwe-22
Published: Wed May 06 2026 (05/06/2026, 19:32:13 UTC)
Source: CVE Database V5
Vendor/Project: openmrs
Product: openmrs-core

Description

OpenMRS Core is an open source electronic medical record system platform. In versions 2.7.8 and earlier and versions 2.8.0 through 2.8.5, the module upload endpoint at POST `/openmrs/ws/rest/v1/module` is vulnerable to a Zip Slip path traversal attack. During automatic extraction of uploaded .omod archives in `WebModuleUtil.startModule()`, ZIP entries under web/module/ are checked only to see whether the full entry path starts with `..,` and the remaining path is then concatenated into the destination path without normalization or a boundary check. A crafted archive can therefore include entries such as `web/module/../../../../malicious.jsp` and cause files to be written outside the intended module directory. An authenticated attacker with module upload access can write arbitrary files to locations such as the web application root and achieve remote code execution by uploading a JSP file and then requesting it. The issue is compounded by the fact that the module.allow_web_admin runtime property is enforced in the legacy UI controller but not in the REST API upload path, so deployments relying on that property to block web-based module administration remain exposed through the REST endpoint. This issue has been fixed in versions after 2.7.8 in the 2.7.x line and in version 2.8.6 and later.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/06/2026, 20:06:32 UTC

Technical Analysis

The OpenMRS Core electronic medical record platform is affected by a CWE-22 path traversal vulnerability (CVE-2026-40076) in its module upload REST endpoint at POST `/openmrs/ws/rest/v1/module`. The vulnerability occurs during automatic extraction of uploaded .omod ZIP archives in the WebModuleUtil.startModule() method. The code checks if ZIP entry paths start with '..,' but does not normalize or enforce directory boundaries, allowing crafted archives to write files outside the intended module directory. An authenticated attacker with module upload access can write arbitrary files, including JSP web shells, to the web application root, enabling remote code execution. The module.allow_web_admin runtime property is enforced in the legacy UI but not in the REST API, leaving some deployments exposed. The issue is fixed in versions after 2.7.8 in the 2.7.x branch and from 2.8.6 onward.

Potential Impact

An authenticated attacker with module upload permissions can exploit this vulnerability to write arbitrary files outside the intended directory, including placing malicious JSP files in the web root. This can lead to remote code execution on the server hosting OpenMRS. The vulnerability bypasses intended administrative restrictions due to inconsistent enforcement of the module.allow_web_admin property. The CVSS 4.0 score is 9.4 (critical), reflecting the high impact and ease of exploitation with high privileges.

Mitigation Recommendations

This vulnerability has been fixed in OpenMRS Core versions after 2.7.8 in the 2.7.x line and in version 2.8.6 and later. Users should upgrade to these fixed versions to remediate the issue. There is no official patch or temporary fix indicated beyond upgrading. Deployments relying on the module.allow_web_admin property to restrict module uploads should be aware that this property is not enforced in the REST API upload endpoint and should upgrade promptly. Patch status is not explicitly confirmed beyond the stated fixed versions; users should verify with the official OpenMRS advisories for the latest remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-09T00:39:12.205Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 69fb9bbdcbff5d8610414e9f

Added to database: 5/6/2026, 7:51:25 PM

Last enriched: 5/6/2026, 8:06:32 PM

Last updated: 5/7/2026, 2:01:05 AM

Views: 12

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses