/

CVE-2026-126428

Severity:

HIGH RISK

(7.5)

Unrestricted File Upload (CWE-434) in OpenEMR ERA Handler

CVE-2026-126428

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.5)

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 before 8.5.0 can store attacker-controlled PHP when an authenticated billing user uploads a malformed ERA file through era_payments.php. If a database-write primitive is also available to register a background service that loads the stored file, the PHP may execute as the web-server user.

Affected context

The vulnerability concerns ERA file handling and background-service loading in OpenEMR deployments before 8.5.0. Risk depends on whether a malformed upload can leave executable PHP in a stored .edi file and whether a database-write path can register a service that loads that file.

Exploit preconditions

  • Attack surface: ERA file upload through era_payments.php
  • Required access: An authenticated billing user who can submit ERA files, plus a way to write a suitable background-service database row
  • Trigger point: A background service uses require_once to load the stored .edi file
  • Why exploitation is possible: Attacker-controlled PHP is stored in a file that is later loaded as PHP code; a database-write primitive, such as SQL injection, may enable registration of the loading service

Why this happens

The issue arises when uploaded ERA content is stored in a form that can contain executable PHP and is later included by the application. This reflects CWE-434: Unrestricted Upload of File with Dangerous Type: uploaded content is not sufficiently constrained to prevent dangerous file content from reaching an execution-capable loading path.

Potential impact

  • An attacker could execute code with the privileges of the web-server user.
  • The application or data accessible to that account may be compromised.
  • The compromised application could be used to affect connected systems, depending on the web server's permissions and network access.

General mitigation guidance

Defensive patterns focus on treating uploaded files as untrusted data and preventing them from entering executable loading paths. Common approaches include:

  • Accepting only required file formats and validating their structure and content with constrained parsers.
  • Storing uploads outside executable web or application paths, with non-executable permissions.
  • Avoiding dynamic inclusion of uploaded files and using data-only parsing APIs.
  • Restricting who can upload ERA files and who can create or modify background-service records.
  • Applying least privilege to the web-server account and limiting database-write capabilities.

How teams detect issues like this

  • Review upload handlers for checks that rely only on file names or extensions rather than validating file content and format.
  • Search for code paths that include or require uploaded files, particularly files stored with data-oriented extensions.
  • Audit database access paths and permissions for unauthorized creation or modification of background-service records.
  • Use static analysis and code review policies to flag executable inclusion of user-controlled files and risky upload handling.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-r6wm-8m2j-c3q9
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-rce-via-stored-era-upload-and-background-services

Frequently asked

questions

It can be triggered through application functionality, but the described chain requires both an authenticated billing user who can upload an ERA file and a database-write path to register a loading background service.

The upload requires authenticated billing access. Registering the background service requires a separate database-write capability, which could arise from another vulnerability or an overly permissive access path.

Treat uploads strictly as data: validate them with a constrained parser, store them outside executable paths, and never include uploaded content as PHP.

Enforce format and content validation, restrict upload and database-write privileges, and review code for execution-capable operations on user-controlled files.

Find out what's already
exploitable in your codebase.