/

CVE-2026-126486

Severity:

HIGH RISK

(7.6)

Missing Authorization (CWE-862) in OpenEMR Portal Forms

CVE-2026-126486

Analyzed

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized modification and disclosure of portal document templates

Severity:

HIGH RISK

(7.6)

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's portal document template endpoint has modes that do not consistently enforce authorization or CSRF checks. An authenticated staff user may be able to alter template assignments or categories, push templates to patients, or read template contents.

Affected context

The issue occurs in portal/import_template.php when requests use template modes without the expected admin/forms access-control checks and CSRF protections. Risk depends on the endpoint being reachable and an authenticated staff account being able to submit requests to it.

Exploit preconditions

  • Attack surface: The portal template endpoint, portal/import_template.php
  • Required access: An authenticated staff session
  • Trigger point: A request to an affected mode, such as save_profiles, get, or getPdf
  • Why exploitation is possible: Some modes lack the authorization checks that should restrict sensitive template operations; missing CSRF checks may also allow requests to be induced through a staff user's active session, depending on browser and deployment protections.

Why this happens

The endpoint does not consistently enforce authorization for each sensitive operation. This is an improper authorization pattern mapped to CWE-862: Missing Authorization: a request can reach a protected action without verifying that the authenticated user has the required permissions. The absence of CSRF checks on affected modes can further weaken request integrity.

Potential impact

  • An authenticated staff user may delete template profile assignments.
  • Template categories or patient template assignments could be changed without the intended permissions.
  • Template bodies may be disclosed to users who should not have access.
  • Missing CSRF protections could allow unintended actions through a staff user's active session.

General mitigation guidance

Defensive patterns include enforcing authorization checks on every sensitive endpoint action, using deny-by-default access rules, and verifying permissions at the point of operation. Require anti-CSRF protections for state-changing requests, restrict access to sensitive template data, and apply least privilege to staff roles. Keep authorization and request-integrity checks independent of client-side controls.

How teams detect issues like this

  • Review each endpoint mode and confirm it performs server-side authorization before reading or changing sensitive data.
  • Use static analysis or code review checks to flag sensitive handlers without explicit permission checks or CSRF validation.
  • Test role-based access policies to ensure staff accounts cannot invoke admin-only template operations.
  • Monitor audit logs for unusual template reads, assignment deletions, or category changes.
  • Apply automated security checks in development workflows to identify missing authorization patterns.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-phvv-q7m7-8mc2
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-missing-authorization-via-portal-import-template-php

Frequently asked

questions

The described operations require an authenticated staff session; the affected endpoint modes do not consistently enforce the intended permissions.

No. The issue is that some modes can be reached by authenticated staff users without the expected admin/forms authorization checks.

Enforce server-side, deny-by-default authorization for every sensitive mode, and add CSRF protections to state-changing requests.

Use centralized authorization checks, test access across user roles, and include code review and automated checks for missing authorization and CSRF controls.

Find out what's already
exploitable in your codebase.