☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-29789

CVE-2025-29789 Directory Traversal in Openemr
📅 PUBLISHED: 2025-03-25 20:29 UTC 🔄 UPDATED: 2026-09-23 20:34 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.85%
👁️
0.85% probability
21.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.6
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-29789 is a directory traversal vulnerability in OpenEMR, a free and open-source electronic health records and medical practice management application. The vulnerability exists in the "Load Code" feature of versions prior to 7.3.0. An attacker can exploit this flaw to read arbitrary files on the server, potentially accessing sensitive patient data, configuration files, or other critical system resources. The vulnerability is patched in version 7.3.0.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a direct vulnerability in the OpenEMR application source code. The risk is primarily to organizations that self-host OpenEMR.

CVSS Breakdown & Threat Level

The CVSS score is listed as 0.0, which is likely a placeholder or uncalculated. Based on the nature of the vulnerability (directory traversal), a reasonable CVSS v3.1 vector would be:

  • Attack Vector (AV): Network (N) - The vulnerability is exploitable remotely.
  • Attack Complexity (AC): Low (L) - No special conditions are required.
  • Privileges Required (PR): Low (L) - An attacker likely needs some level of access to the application, possibly a valid user account.
  • User Interaction (UI): None (N) - No user interaction is required.
  • Scope (S): Unchanged (U) - The vulnerability does not affect resources beyond the vulnerable component.
  • Confidentiality (C): High (H) - Sensitive files can be read.
  • Integrity (I): None (N) - File modification is not possible.
  • Availability (A): None (N) - No impact on availability.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Estimated Base Score: 6.5 (Medium)

Threat Level: Medium. The vulnerability allows for information disclosure, which is critical in a healthcare context due to HIPAA and other data privacy regulations.

Deep Dive & Mechanics

The vulnerability is located in the "Load Code" feature of OpenEMR. This feature is designed to load code snippets or templates from the server's file system. The flaw is a classic directory traversal (path traversal) vulnerability, where user-supplied input (likely a file path or filename) is not properly sanitized.

Mechanism:

  1. The "Load Code" feature accepts a file path as input.
  2. The application fails to validate or sanitize the input to prevent the use of ../ (parent directory) sequences.
  3. An attacker can craft a request with a path like ../../../../etc/passwd to read arbitrary files outside the intended directory.
  4. The application then reads and returns the contents of the specified file.

This allows an attacker to read sensitive files such as:

  • /etc/passwd (user account information)
  • /etc/shadow (password hashes, if readable)
  • OpenEMR configuration files (e.g., sites/default/sqlconf.php containing database credentials)
  • Patient data files stored on the server
  • Application source code

Vulnerable vs. Patched Code

Vulnerable Code (Pre-7.3.0): The vulnerable code likely directly uses user input to construct a file path without sanitization. A simplified example in PHP:

<?php
$file = $_GET['file'];
$content = file_get_contents($file);
echo $content;
?>

Patched Code (7.3.0+): The patched code sanitizes the input to prevent directory traversal. A simplified example:

<?php
$file = $_GET['file'];
$baseDir = '/var/www/openemr/code_templates/';
$file = basename($file); // Remove directory components
$file = str_replace('..', '', $file); // Remove parent directory references
$file = $baseDir . $file;
if (file_exists($file) && strpos(realpath($file), $baseDir) === 0) {
    $content = file_get_contents($file);
    echo $content;
} else {
    echo "File not found.";
}
?>

The patched code uses basename() to strip directory components, removes .. sequences, and verifies that the resolved path is within the allowed base directory.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy a vulnerable version of OpenEMR (e.g., 7.2.0) in a controlled environment (e.g., Docker).
  2. Obtain a valid user account (e.g., by registering or using default credentials).

Exploitation Steps:

  1. Log in to OpenEMR.
  2. Navigate to the "Load Code" feature (likely under Administration or a similar menu).
  3. Intercept the request using a proxy like Burp Suite.
  4. Modify the request parameter that specifies the file path. For example, if the parameter is file, change it to ../../../../etc/passwd.
  5. Send the request.
  6. Observe the response, which should contain the contents of /etc/passwd.

Example HTTP Request (using curl):

curl -X GET "http://target-openemr/load_code.php?file=../../../../etc/passwd" -b "PHPSESSID=your_session_cookie"

Blue Team (Defensive)

Detection:

  • Monitor web server logs for requests containing ../ or ..%2f in parameters related to file loading.
  • Look for requests to load_code.php or similar endpoints with suspicious file paths.
  • Use a Web Application Firewall (WAF) to block directory traversal patterns.

Prevention:

  • Apply the patch by upgrading to OpenEMR 7.3.0 or later.
  • Implement input validation and sanitization on all user-supplied file paths.
  • Use a whitelist of allowed files or directories.
  • Run the application with the least privileges necessary (e.g., do not run as root).
  • Use a chroot jail or containerization to limit the impact of a successful exploit.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests containing ../ or ..%2f in parameters (e.g., file=../../../../etc/passwd).
    • Requests to load_code.php or similar endpoints with unusual file paths.
    • Outbound connections from the server to unknown IPs (if data exfiltration occurs).
  • File System IOCs:

    • Unexpected access to sensitive files like /etc/passwd, /etc/shadow, or database configuration files.
    • Modified application logs showing file read attempts outside the web root.
  • Log IOCs:

    • Web server access logs showing 200 OK responses for requests with directory traversal patterns.
    • Application error logs indicating failed file reads or permission errors.

Detection Engineering

YARA Rule

rule CVE_2025_29789_Directory_Traversal {
    meta:
        description = "Detects directory traversal attempts targeting OpenEMR Load Code feature"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-29789"
    strings:
        $traversal1 = "..\\" ascii wide nocase
        $traversal2 = "..%2f" ascii wide nocase
        $traversal3 = "..%5c" ascii wide nocase
        $param1 = "file=" ascii wide nocase
        $param2 = "path=" ascii wide nocase
        $param3 = "load_code" ascii wide nocase
    condition:
        any of ($param*) and any of ($traversal*)
}

Sigma Rule

title: CVE-2025-29789 OpenEMR Directory Traversal
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects directory traversal attempts against OpenEMR Load Code feature
author: Valters IT
date: 2025/04/10
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2025-29789
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-uri-query|contains:
            - '..\\'
            - '..%2f'
            - '..%5c'
        cs-uri-stem|contains:
            - 'load_code'
    condition: selection
falsepositives:
    - Legitimate use of file paths with dots (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-29789 OpenEMR Directory Traversal Attempt"; flow:to_server,established; content:"GET"; http_method; content:"load_code"; http_uri; content:".."; http_uri; distance:0; pcre:"/\.\.\//i"; classtype:attempted-recon; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade OpenEMR: The primary remediation is to upgrade to version 7.3.0 or later, which contains the patch for this vulnerability.
  2. Apply Virtual Patching: If immediate upgrade is not possible, use a Web Application Firewall (WAF) to block requests containing directory traversal patterns (e.g., ../, ..%2f) in parameters associated with the Load Code feature.
  3. Restrict File Permissions: Ensure that the web server runs with minimal privileges and that sensitive files (e.g., /etc/shadow, database configs) are not readable by the web server user.

Long-Term Mitigations:

  1. Input Validation: Implement strict input validation for all file path parameters. Use a whitelist of allowed files or directories.
  2. Security Audits: Regularly conduct security audits and penetration testing of the OpenEMR instance.
  3. Monitoring: Implement robust logging and monitoring to detect and alert on suspicious file access patterns.
  4. Least Privilege: Run the application with the least privileges necessary and use containerization or chroot jails to limit the impact of a successful exploit.

Valters IT
DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-29789/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.