/

CVE-2026-124480

Severity:

HIGH RISK

(8.8)

Authorization Bypass (CWE-862) in OpenEMR FHIR API

CVE-2026-124480

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-862

Impact:

Cross-patient exposure of protected health information (PHI)

Severity:

HIGH RISK

(8.8)

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.4.0 has an authorization bypass in its FHIR QuestionnaireResponse endpoint. A low-privileged authenticated user who supplies the session-exposed CSRF token in the APICSRFTOKEN header may bypass FHIR scope checks and read questionnaire responses belonging to other patients.

Affected context

The issue affects OpenEMR deployments before 8.4.0 where authenticated users can access the FHIR API. The reported weakness involves GET /fhir/QuestionnaireResponse: the APICSRFTOKEN header can be used to skip FHIR scope checks, potentially exposing questionnaire answers across patients.

Exploit preconditions

  • Attack surface: The OpenEMR FHIR API, specifically the QuestionnaireResponse endpoint
  • Required access: A low-privileged authenticated account and access to the session-exposed api_csrf_token_js value
  • Trigger point: A request to GET /fhir/QuestionnaireResponse carrying the token in the APICSRFTOKEN header
  • Why exploitation is possible: The token handling path can bypass FHIR scope authorization checks, allowing a request to access data beyond the user's authorized patient scope

Why this happens

The underlying issue is an authorization enforcement failure mapped to CWE-862: Missing Authorization. The endpoint's handling of the APICSRFTOKEN header allows a session-exposed token to bypass FHIR scope checks rather than consistently enforcing whether the authenticated user is permitted to read the requested patient data.

Potential impact

  • An attacker could read QuestionnaireResponse records for patients outside their permitted scope.
  • Questionnaire answers may expose sensitive personal or health information.
  • Site-wide data exposure could increase privacy, regulatory, and incident-response risks.

General mitigation guidance

Defensive design should ensure that every FHIR request is authorized against the authenticated user's permissions and the specific patient resource being accessed. CSRF tokens should not function as authorization credentials or bypass scope enforcement.

Common protective patterns include:

  • Applying server-side authorization checks consistently on every endpoint and resource.
  • Enforcing patient-level and FHIR-scope restrictions independently of CSRF validation.
  • Treating session-exposed values and client-supplied headers as untrusted input.
  • Using secure-by-default access policies and least-privilege roles.
  • Testing authorization boundaries for cross-patient access as part of security reviews.

How teams detect issues like this

Review FHIR endpoint code and policies for paths where CSRF token handling can skip or weaken authorization checks. Static analysis and code review should look for missing resource-level authorization, inconsistent checks across request paths, and reliance on client-supplied headers for access decisions.

Runtime monitoring can flag authenticated users requesting QuestionnaireResponse data across many patient records or outside their assigned scope. Automated tests and policy enforcement can verify that authorization is checked for every resource request, including requests with valid CSRF tokens.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-5xf2-3h9x-f4m6
vulncheck.comvulncheck.com/advisories/openemr-before-8.4.0-authorization-bypass-via-fhir-questionnaireresponse-apicsrftoken

Frequently asked

questions

The described attack requires an authenticated, low-privileged account and access to the session-exposed token. The impact depends on the deployment's account permissions and FHIR configuration.

QuestionnaireResponse records outside the user's permitted patient scope may be readable, potentially revealing sensitive health information.

Enforce server-side authorization for every FHIR request and patient resource, independently of CSRF token handling.

Treat client-supplied headers as untrusted, apply least-privilege access policies, and test that authorization boundaries hold across all endpoint paths.

Find out what's already
exploitable in your codebase.