/

CVE-2026-126481

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in OpenEMR ERA Payment Files

CVE-2026-126481

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file overwrite

Severity:

HIGH RISK

(8.1)

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

OpenEMR contains a path traversal vulnerability in its ERA payment and EOB search handling that can let authenticated billing users write attacker-controlled content outside the intended ERA directory. The risk arises when an uploaded X12 835 file contains crafted path information that is used to determine a file destination without adequate containment checks.

Affected context

The vulnerability affects file handling in era_payments.php and sl_eob_search.php. It becomes relevant when an authenticated billing user can upload an X12 835 file and the application processes its GS04 element to construct a destination path. The impact depends on which locations are writable by the web server.

Exploit preconditions

  • Attack surface: ERA payment processing and EOB search file handling
  • Required access: An authenticated account with billing access sufficient to submit an X12 835 file
  • Trigger point: Processing an uploaded file whose GS04 value influences the output path
  • Why exploitation is possible: Path information from the file can escape the intended ERA directory if the application does not constrain the resolved destination

Why this happens

The underlying issue is insufficient validation and containment of a file path derived from untrusted input. If traversal sequences in the GS04 element are incorporated into a destination path without reliably restricting the resolved path to the ERA directory, the application may write outside that directory. This is a path traversal weakness covered by CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • Attacker-controlled content could overwrite .edi or .835 files in locations writable by the web server.
  • File integrity or application behavior could be affected, depending on which files are overwritten.
  • Sensitive data or services could be disrupted if important files are modified.
  • The consequences could extend to other applications or processes that rely on writable files.

General mitigation guidance

Defensive patterns focus on preventing untrusted file metadata from selecting arbitrary destinations.

  • Derive storage paths from trusted, server-controlled identifiers rather than uploaded values.
  • Canonicalize candidate paths and verify that they remain within the intended storage directory before writing.
  • Apply strict validation to file metadata, while treating validation as an additional control rather than the sole path boundary.
  • Store uploads in a dedicated location with narrowly scoped write permissions, and run the web server with least privilege.
  • Prefer storage designs that do not allow uploaded content to overwrite existing files.

How teams detect issues like this

  • Use static analysis to identify file-write operations whose paths are influenced by request data or uploaded-file metadata.
  • Review code paths that parse GS04 and other file fields, especially where values are joined with filesystem paths.
  • Check that path canonicalization and directory-boundary enforcement occur before every relevant file write.
  • Apply policy checks that flag untrusted input flowing into filesystem destinations and verify that web-server write permissions are limited.
  • Automated code review tools can help identify risky input-to-file-write flows.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-mf55-7h68-r2rp
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-path-traversal-via-era-835-file-upload

Frequently asked

questions

Exploitation requires an authenticated user with sufficient billing access to submit an X12 835 file for processing.

Direct filesystem access is not described as necessary. The relevant access is the ability to submit a file that the application processes.

Keep destination paths under server control, verify canonical paths remain inside the intended directory, and prevent uploads from overwriting existing files.

Treat uploaded metadata as untrusted, review all input-to-file-write flows, and limit the directories and files the application can modify.

Find out what's already
exploitable in your codebase.