{"answers":{"affected":"4 open source packages ship an affected version, including org.openmrs.web:openmrs-web. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40076 exists.","fix":"No fix has been published for CVE-2026-40076 yet. Limit exposure of the affected software until one is available.","what":"CVE-2026-40076 is a critical path traversal vulnerability in openmrs-core, published on 6 May 2026. An attacker needs administrator access to exploit it, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40076 and fix it if it is affected.\n\nWhat it is: CVE-2026-40076 is a critical path traversal vulnerability in openmrs-core, published on 6 May 2026. An attacker needs administrator access to exploit it, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40076 exists.\n\nAffected packages and fixed versions:\n- org.openmrs.web:openmrs-web (Maven): affected all versions up to 2.7.8; no fix listed\n- org.openmrs.web:openmrs-web (Maven): affected all versions up to 2.7.8; no fix listed\n- org.openmrs.web:openmrs-web (Maven): affected from 2.8.0 up to 2.8.5; no fix listed\n- org.openmrs.web:openmrs-web (Maven): affected from 2.8.0 up to 2.8.5; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40076/ (Markdown: https://insights.sbomify.com/CVE-2026-40076/index.md)","id":"CVE-2026-40076","markdown":"https://insights.sbomify.com/CVE-2026-40076/index.md","name":"CVE-2026-40076","record":{"aliases":["GHSA-78fc-9688-w8xw"],"analysis":{"component_type":"web_application","fix_type":"upgrade","impacts":["code_execution","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"OpenMRS Core","requires_auth":"high_privilege","summary":"Authenticated attackers can exploit a Zip Slip vulnerability in OpenMRS Core module uploads to write arbitrary files and execute remote code.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"openmrs","vendor":"openmrs"}],"cvss":{"score":9.4,"severity":"critical","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","version":"4.0"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"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.\n\nAn 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.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":false,"headline":"OpenMRS Core arbitrary file write and code execution via Zip Slip in module upload","id":"CVE-2026-40076","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":4,"n_references":1,"next":{"headline":"Beszel has an IDOR in hub API endpoints that read system ID from URL parameter","id":"CVE-2026-40077"},"packages":[{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":["2.7.8"],"package":"org.openmrs.web:openmrs-web","purl":null,"source":"GHSA-78fc-9688-w8xw"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":["2.7.8"],"package":"org.openmrs.web:openmrs-web","purl":"pkg:maven/org.openmrs.web/openmrs-web","source":"GHSA-78fc-9688-w8xw"},{"ecosystem":"Maven","fixed":[],"introduced":["2.8.0"],"last_affected":["2.8.5"],"package":"org.openmrs.web:openmrs-web","purl":null,"source":"GHSA-78fc-9688-w8xw"},{"ecosystem":"Maven","fixed":[],"introduced":["2.8.0"],"last_affected":["2.8.5"],"package":"org.openmrs.web:openmrs-web","purl":"pkg:maven/org.openmrs.web/openmrs-web","source":"GHSA-78fc-9688-w8xw"}],"prev":{"headline":"OpenMRS Core arbitrary file read via path traversal in ModuleResourcesServlet","id":"CVE-2026-40075"},"products":["openmrs-core"],"published":"2026-05-06","related":[{"cvss_score":10,"headline":"Deserialization in n/a","id":"CVE-2018-19276","kev_date_added":null,"published":"2019-03-17"},{"cvss_score":9.8,"headline":"SQL injection in n/a","id":"CVE-2021-43094","kev_date_added":null,"published":"2022-05-10"},{"cvss_score":9.8,"headline":"Deserialization in n/a","id":"CVE-2017-12796","kev_date_added":null,"published":"2017-10-23"},{"cvss_score":8.2,"headline":"OpenMRS Core arbitrary file read via path traversal in ModuleResourcesServlet","id":"CVE-2026-40075","kev_date_added":null,"published":"2026-05-05"},{"cvss_score":8,"headline":"Cross-site request forgery in n/a","id":"CVE-2025-25928","kev_date_added":null,"published":"2025-03-11"},{"cvss_score":7.5,"headline":"Directory Traversal in OpenMRS Startup Filter","id":"CVE-2022-23612","kev_date_added":null,"published":"2022-02-22"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-05-07","vendors":["openmrs"]},"summary":"Authenticated attackers can exploit a Zip Slip vulnerability in OpenMRS Core module uploads to write arbitrary files and execute remote code.","url":"https://insights.sbomify.com/CVE-2026-40076/"}