Skip to main content

OpenMRS Core CVE-2026-40075

HIGH
Path Traversal (CWE-22)
2026-05-04 https://github.com/openmrs/openmrs-core GHSA-jjgj-cx3q-pw4w
8.2
CVSS 4.0 · Vendor: https://github.com/openmrs/openmrs-core
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify OpenMRS instance with vulnerable Tomcat version
  2. Delivery
    Enumerate valid module IDs from login page resources
  3. Exploit
    Craft path traversal request with ..;/ sequences
  4. Install
    ModuleResourcesServlet processes unsanitized path
  5. C2
    Retrieve arbitrary filesystem files
  6. Execute
    Extract credentials from configuration files
  7. Impact
    Pivot to backend systems

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the target OpenMRS deployment to run on Apache Tomcat version earlier than 8.5.31 (for Tomcat 8.5.x) or earlier than 9.0.10 (for Tomcat 9.x), as these container versions do not mitigate the ..;/ path parameter bypass technique. The attacker must identify at least one valid installed module ID on the target instance, obtainable through client-side observation of resource requests made by the login page or through common module name enumeration. No authentication, user interaction, or special application configuration is required-the /openmrs/moduleResources/ endpoint is intentionally exposed pre-authentication to serve static assets for the login interface. Deployments on Tomcat 8.5.31+, 9.0.10+, or later are protected at the container layer regardless of OpenMRS version, though the underlying code vulnerability remains. The vulnerability is exploitable against default OpenMRS configurations on vulnerable Tomcat versions.

Impact

This vulnerability presents moderate real-world risk despite its High CVSS score. The attack vector is network-based with low complexity (AV:N/AC:L) and requires no authentication (PR:N), privileges, or user interaction (UI:N), enabling straightforward exploitation. However, successful exploitation has a critical prerequisite: the target must run on Apache Tomcat versions earlier than 8.5.31 (released March 2018) or 9.0.10, significantly limiting the vulnerable population six years post-disclosure. The CVSS vector correctly reflects high confidentiality impact (C:H) as attackers can extract database credentials, API keys, and other secrets from configuration files, though no integrity or availability impact exists (I:N/A:N). No EPSS score, KEV status, or public POC availability data was provided, preventing complete exploitation probability assessment. The SSVC decision framework would likely classify this as 'Scheduled' rather than 'Immediate' priority due to the Tomcat version dependency, though organizations running legacy Tomcat installations face 'Out-of-Band' priority. The partial fix availability (2.8.6 released but no patch for 2.7.x branch) creates ongoing exposure for installations on the legacy branch. Real-world impact depends entirely on Tomcat version-modern deployments are container-protected despite the application-layer defect remaining unfixed.

Exploit ScenarioDerived

An external attacker identifies an internet-facing OpenMRS installation running on Tomcat 8.5.30 by fingerprinting the login page. Without authentication, they enumerate installed module names from client-side resource requests and discover the 'legacyui' module. The attacker crafts an HTTP GET request to /openmrs/moduleResources/legacyui/..;/..;/..;/..;/..;/..;/etc/passwd which bypasses the Tomcat path traversal protections due to the legacy container version. The ModuleResourcesServlet processes the malformed path without validation, resolves it to the absolute filesystem path /etc/passwd, and returns the file contents in the HTTP 200 response. Using the same technique, the attacker then retrieves application configuration files containing database credentials and API keys, enabling lateral movement to backend systems.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 04, 2026

Path traversal in OpenMRS Core's ModuleResourcesServlet allows unauthenticated attackers to read arbitrary files from the server filesystem, including sensitive configuration files and system files like /etc/passwd. The vulnerability exists in versions ≤ 2.7.8 and 2.8.0-2.8.5, with exploitation requiring Apache Tomcat < 8.5.31 where path parameter bypass protections are absent. Fix available in version 2.8.6 for the 2.8.x branch; no patch released for 2.7.x series at time of analysis. CVSS 7.5 (High) reflects network-accessible unauthenticated exploitation with high confidentiality impact.

RemediationAI

Organizations running OpenMRS Core 2.8.x should immediately upgrade to version 2.8.6, which implements path normalization and boundary validation checks in ModuleResourcesServlet per the vendor advisory at https://github.com/openmrs/openmrs-core/security/advisories/GHSA-jjgj-cx3q-pw4w. For installations on the 2.7.x branch where no official patch exists, the primary compensating control is upgrading the underlying Apache Tomcat container to version 8.5.31 or later (or 9.0.10+ for Tomcat 9.x), which blocks the ..;/ bypass technique at the container level-this mitigation addresses the exploit vector but does not remediate the underlying code defect. As a secondary defense-in-depth measure, implement web application firewall (WAF) rules or reverse proxy filtering to detect and block requests containing path traversal sequences (../, ..;/, %2e%2e%2f) to the /openmrs/moduleResources/ endpoint, though this creates ongoing operational overhead and may generate false positives. If upgrading Tomcat is not immediately feasible, consider restricting network access to the OpenMRS instance to trusted IP ranges only, though this significantly impacts usability and does not address insider threat scenarios. Organizations unable to upgrade either OpenMRS or Tomcat should assess their exposure by verifying which module resources are actually required pre-authentication and consider temporarily disabling unused modules to reduce attack surface.

Affected Packages

maven org.openmrs.web:openmrs-web fix: 2.8.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in maven

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability stems from improper input validation in the ModuleResourcesServlet Java class within OpenMRS Core's web module (pkg:maven/org.openmrs.web:openmrs-web). This servlet handles static resource requests for OpenMRS modules via the /openmrs/moduleResources/{moduleid} endpoint and is intentionally excluded from authentication filters because these resources must be accessible on the login page. The root cause (CWE-22: Improper Limitation of a Pathname to a Restricted Directory) exists in the getFile() method's unsafe concatenation of user-controlled path input without normalization or boundary validation. The code directly appends unsanitized path segments to filesystem paths without checking whether the resolved path remains within the intended module resources directory. Exploitation relies on a known Apache Tomcat path traversal bypass technique using the ..; sequence, which was patched in Tomcat 8.5.31/9.0.10 but remains unmitigated in the OpenMRS application layer. The codebase already contains correct path traversal protection patterns in StartupFilter.java using normalize().startsWith() validation, but this protection was not applied consistently to ModuleResourcesServlet.

Know when Tomcat gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/openmrs/openmrs-core) PRIMARY 8.2 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/openmrs/openmrs-core) · only source for this CVE.

CVSS VectorVendor: https://github.com/openmrs/openmrs-core

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
May 05, 2026 - 22:22 NVD
7.5 (HIGH) 8.2 (HIGH)
CVE Published
May 04, 2026 - 17:18 nvd
HIGH 7.5

DescriptionCVE.org

Affected Versions

version ≤ 2.7.8 (latest version at time of disclosure)

https://github.com/openmrs/openmrs-core

Impact

The /openmrs/moduleResources/{moduleid} endpoint in OpenMRS Core is vulnerable to a path traversal attack. The ModuleResourcesServlet does not properly validate user-supplied path input, allowing an attacker to traverse directories and read arbitrary files from the server filesystem (e.g., /etc/passwd, application configuration files containing database credentials).

This endpoint serves static module resources (CSS, JS, images) and is not protected by authentication filters, as these resources are required for rendering the login page. Therefore, this vulnerability can be exploited by an unauthenticated attacker.

> Note: Successful exploitation requires the target deployment to run on Apache Tomcat < 8.5.31, where the ..; path parameter bypass is not mitigated by the container. Deployments on Tomcat ≥ 8.5.31 / ≥ 9.0.10 are protected at the container level, though the underlying code defect remains. >

Steps to Reproduce

  1. Identify a valid installed module ID on the target OpenMRS instance (e.g., legacyui).
  2. Send the following HTTP request:

<img width="1038" height="798" alt="image" src="https://github.com/user-attachments/assets/7d10ee0e-4d81-4c01-bc84-a1bf5715f170" />

  1. The server responds with HTTP 200 and the contents of /etc/passwd:

<img width="1028" height="843" alt="image" src="https://github.com/user-attachments/assets/b6806a7e-ff52-4f51-8f7f-7ea4e9754d10" />

Root Cause Analysis

The vulnerability exists in ModuleResourcesServlet.java (web/src/main/java/org/openmrs/module/web/ModuleResourcesServlet.java).

The getFile() method constructs a filesystem path from user-controlled input without performing path boundary validation:

java
protected File getFile(HttpServletRequest request) {
    // Step 1: User-controlled path input
    String path = request.getPathInfo();

    // Step 2: Extract module from path prefix
    Module module = ModuleUtil.getModuleForPath(path);
    if (module == null) { return null; }

    // Step 3: Strip module ID prefix - no traversal check
    String relativePath = ModuleUtil.getPathForResource(module, path);

    // Step 4: Concatenate into absolute path
    String realPath = getServletContext().getRealPath("")
        + MODULE_PATH
        + module.getModuleIdAsPath()
        + "/resources"
        + relativePath;  // contains "/../../../etc/passwd"

    realPath = realPath.replace("/", File.separator);

    // Step 5: No normalize().startsWith() boundary check
    File f = new File(realPath);
    if (!f.exists()) { return null; }

    return f;  // Arbitrary file returned to client
}

The helper method ModuleUtil.getPathForResource() only strips the module ID prefix and performs no sanitization:

java
public static String getPathForResource(Module module, String path) {
    if (path.startsWith("/")) {
        path = path.substring(1);
    }
    return path.substring(module.getModuleIdAsPath().length());
    // Returns unsanitized remainder, e.g., "/../../../../../../etc/passwd"
}

The resulting path resolves as:

{webapp}/WEB-INF/view/module/legacyui/resources/../../../../../../etc/passwd
  → /etc/passwd

Notably, the same codebase already implements correct path traversal protection in StartupFilter.java:

java
// StartupFilter.java - correct protection
fullFilePath = fullFilePath.resolve(httpRequest.getPathInfo());
if (!(fullFilePath.normalize().startsWith(filePath))) {
    log.warn("Detected attempted directory traversal...");
    return;  // Request rejected
}

This check is absent from ModuleResourcesServlet.

Remediation

Add a path boundary check after constructing realPath and before returning the File object. The fix should use normalize() + startsWith() to ensure the resolved path stays within the allowed module resources directory:

java
File f = new File(realPath);
Path allowedBase = Paths.get(getServletContext().getRealPath(""), "WEB-INF", "view", "module");
if (!f.toPath().normalize().startsWith(allowedBase.normalize())) {
    log.warn("Blocked path traversal attempt: {}", request.getPathInfo());
    return null;
}

This is consistent with the existing pattern used in StartupFilter.java and TestInstallUtil.java within the same project.

Executive ViewAI

Why It Matters

OpenMRS Core versions 2.7.8 and below, and 2.8.0-2.8.5, contain a path traversal vulnerability in ModuleResourcesServlet that enables unauthenticated attackers to read arbitrary files from the server, including sensitive configuration and system files. Organizations running affected versions face immediate risk of credential exposure and system compromise through publicly accessible file access, making this a critical data confidentiality threat that requires urgent patching or containment.

Business Impact: High
Compensating Controls

No vendor-released patch identified for 2.7.x series at time of analysis. For all affected versions: restrict network access to ModuleResourcesServlet endpoints via firewall or reverse proxy rules; disable module resource serving if unused; implement strict input validation and path normalization at the application firewall level; require immediate upgrade to 2.8.6 as primary remediation path. Vendor-released patch available for 2.8.x branch (version 2.8.6).

Threat Intelligence Overview

EPSS Score
0.1%
Top 76% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +41
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)CVE.org

pkg:maven/org.openmrs.web:openmrs-web
pkg:maven/org.openmrs.web:openmrs-web

More in Tomcat

View all
CVE-2017-12617 HIGH POC
8.1 Oct 04

When running Apache Tomcat versions 9.0.0.M1 to 9.0.0, 8.5.0 to 8.5.22, 8.0.0.RC1 to 8.0.46 and 7.0.0 to 7.0.81 with HTT

CVE-2020-1938 CRITICAL POC
9.8 Feb 24

When using the Apache JServ Protocol (AJP), care must be taken when trusting incoming connections to Apache Tomcat. Rate

CVE-2023-47246 CRITICAL POC
9.8 Nov 10

In SysAid On-Premise before 23.3.36, a path traversal vulnerability leads to code execution after an attacker writes a f

CVE-2016-8735 CRITICAL POC
9.8 Apr 06

Remote code execution is possible with Apache Tomcat before 6.0.48, 7.x before 7.0.73, 8.x before 8.0.39, 8.5.x before 8

CVE-2017-12615 HIGH POC
8.1 Sep 19

When running Apache Tomcat 7.0.0 to 7.0.79 on Windows with HTTP PUTs enabled (e.g. Rated high severity (CVSS 8.1), this

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2019-0232 HIGH POC
8.1 Apr 15

When running on Windows with enableCmdLineArguments enabled, the CGI Servlet in Apache Tomcat 9.0.0.M1 to 9.0.17, 8.5.0

CVE-2014-0050 HIGH POC
7.5 Apr 01

MultipartStream.java in Apache Commons FileUpload before 1.3.1, as used in Apache Tomcat, JBoss Web, and other products,

CVE-2020-13935 HIGH POC
7.5 Jul 14

The payload length in a WebSocket frame was not correctly validated in Apache Tomcat 10.0.0-M1 to 10.0.0-M6, 9.0.0.M1 to

CVE-2018-11784 MEDIUM POC
4.3 Oct 04

When the default servlet in Apache Tomcat versions 9.0.0.M1 to 9.0.11, 8.5.0 to 8.5.33 and 7.0.23 to 7.0.90 returned a r

CVE-2022-29885 HIGH POC
7.5 May 12

The documentation of Apache Tomcat 10.1.0-M1 to 10.1.0-M14, 10.0.0-M1 to 10.0.20, 9.0.13 to 9.0.62 and 8.5.38 to 8.5.78

CVE-2017-12616 HIGH
7.5 Sep 19

When using a VirtualDirContext with Apache Tomcat 7.0.0 to 7.0.80 it was possible to bypass security constraints and/or

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy