/

CVE-2026-24849

Severity:

CRITICAL RISK

(9.9)

Path Traversal in OpenEMR EtherFax Document Disposal

CVE-2026-24849

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Authentication-bypassing file read / Arbitrary file disclosure to any authenticated user

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in OpenEMR's disposeDocument() method allows authenticated users to read arbitrary files from the server filesystem.

Any logged-in user, regardless of role or privilege level, can exploit this flaw to access sensitive server-side files whenever the vulnerable EtherFax action is reachable.

Affected context

This vulnerability occurs in OpenEMR deployments that have the EtherFax functionality available and expose the disposeDocument() method via the web interface.

The issue is triggered when user-controlled input is used to determine which document or file is handled on the server, without properly constraining the resulting file path.

It becomes risky in environments where:

  • Application users include non-admin or low-privileged accounts
  • The web server user has read access to sensitive application, system, or configuration files
  • File paths passed into EtherFaxActions are not normalized or strictly validated against an expected directory

Exploit preconditions

  • Attack surface: HTTP(S) interface to the OpenEMR application, specifically the EtherFax actions endpoint that exposes disposeDocument().
  • Required access: Any valid OpenEMR user account; no administrative privileges are required.
  • Trigger point: An HTTP request that causes disposeDocument() to operate on a file path influenced by user-controlled input.
  • Why exploitation is possible: The method uses attacker-influenced path components without enforcing strict directory constraints or canonicalization, enabling traversal outside the intended document directory and into arbitrary locations on the filesystem.

Why this happens

The underlying issue is improper neutralization and validation of user-controlled path input before it is used in filesystem operations, corresponding to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Within EtherFaxActions.php, the disposeDocument() method appears to construct file paths based on request parameters or other untrusted input, but fails to:

  • Restrict the resulting path to an expected base directory
  • Normalize and canonicalize the path to remove ../ and similar traversal sequences
  • Enforce allowlists of valid document identifiers instead of accepting raw paths

As a result, the file operation logic trusts data derived from the client, enabling low-privileged users to target files outside the intended document storage area.

Potential impact

  • Disclosure of sensitive application configuration files (e.g., database credentials or API keys)
  • Exposure of protected health information (PHI) and other medical records stored in accessible directories
  • Leakage of system files that can aid further attacks (e.g., user lists, log files, or environment configuration)
  • Facilitation of privilege escalation by revealing internal secrets used elsewhere in the infrastructure
  • Assistance in reconnaissance for subsequent exploitation, persistence, or lateral movement

General mitigation guidance

Effective mitigation centers on strictly controlling file paths and removing direct path control from users:

  • Use opaque, server-side identifiers (IDs or hashes) for documents and resolve them to file paths on the server, instead of accepting user-provided paths.
  • Enforce a fixed base directory for all file operations and reject any path that, after canonicalization, falls outside this directory.
  • Normalize and canonicalize requested paths before use, and explicitly block traversal tokens such as ../ or absolute paths.
  • Implement allowlists for file types and locations; only permit operations on known, expected document locations.
  • Run the web server and application with the least-privileged account possible, limiting access to only the directories required for OpenEMR.
  • Treat all user-supplied parameters affecting filesystem operations as untrusted and subject them to centralized validation routines.

How teams detect issues like this

Detection can combine code-centric and operational approaches:

  • Static analysis: Configure rules to flag any use of user-controlled input in file operations (e.g., fopen, file_get_contents, or similar APIs) without path normalization and directory constraints.
  • Code review cues: Look for concatenation of request parameters into file paths, direct use of $_GET/$_POST values as filenames, or logic that trusts client-selected paths for internal documents.
  • Centralized validation checks: Mandate use of shared utilities for resolving document IDs to paths, and review exceptions where raw paths are still used.
  • Runtime monitoring: Analyze web server and application logs for suspicious patterns such as ../ sequences in request parameters or repeated access attempts to configuration and system files.
  • Automated security testing tools and DAST scanners can often detect directory traversal patterns by fuzzing parameters that influence file access.

Sources

SourceLink
github.comgithub.com/openemr/openemr/commit/22f8e53e5769a88b7a16cb223bd197d044c84e5a
github.comgithub.com/openemr/openemr/security/advisories/GHSA-w6vc-hx2x-48pc

Frequently asked

questions

Yes. Any user who can remotely authenticate to the OpenEMR application and reach the EtherFax disposeDocument() functionality can exploit the bug over HTTP(S), without needing shell access to the server.

No. The description indicates that any authenticated user, regardless of privilege level, can trigger the arbitrary file read. Low-privileged or standard accounts are sufficient.

Remove direct path control from the client side, and design the feature around server-side document identifiers that map to vetted paths. All file operations should be constrained to a known base directory, using canonicalization and strict validation to ensure requests cannot escape that boundary.

Establish a common file-access layer that:

  • Accepts only trusted identifiers, not raw filenames
  • Canonicalizes and validates resolved paths against a whitelist of directories
  • Is enforced through code review and automated checks

Combined with least-privileged filesystem permissions and regular security testing, this reduces the likelihood and impact of future traversal vulnerabilities.

Find out what's already
exploitable in your codebase.