/

CVE-2026-126436

Severity:

HIGH RISK

(7.5)

Authorization Bypass (CWE-862) in OpenEMR OAuth2 Clients

CVE-2026-126436

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-862

Impact:

Unauthorized OAuth2 token issuance and access

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 does not enforce the grant types registered for OAuth2 clients, allowing requests to use unregistered flows. Under affected conditions, this may let a client bypass the user consent screen or allow a disabled client to redeem an authorization code using a JWT client assertion.

Affected context

The issue affects OpenEMR OAuth2 flows where client grant-type restrictions are not enforced. Risk depends on how clients, consent, authorization codes, and JWT client assertions are configured and used. The described behavior applies to OpenEMR versions before 8.5.0.

Exploit preconditions

  • Attack surface: OpenEMR's OAuth2 token and authorization flows
  • Required access: An attacker must be able to make requests as, or present credentials for, an OAuth2 client; the exact requirement depends on the deployment's client configuration.
  • Trigger point: A token request uses an unregistered grant_type, or an authorization code is redeemed with a JWT client assertion for a disabled client.
  • Why exploitation is possible: The registered oauth_clients.grant_types values are not enforced, and the described code-redemption path can accept assertions from disabled clients.

Why this happens

The underlying issue is missing authorization enforcement: the application does not consistently check whether a client is permitted to use the requested grant type or whether it remains enabled when redeeming an authorization code. This maps to CWE-862: Missing Authorization, because protected OAuth2 operations proceed without applying the relevant client permissions and status checks.

Potential impact

  • An attacker may obtain tokens through a grant type that was not registered for the client.
  • The password grant may allow a token request to bypass the expected user consent screen.
  • A disabled client could potentially redeem an authorization code using a JWT client assertion.
  • Tokens issued through these paths could enable unauthorized access to resources within their granted scope.

General mitigation guidance

Common defensive patterns include:

  • Enforcing an explicit allowlist of grant types for every client at each relevant authorization and token endpoint.
  • Checking client status and authorization-code binding during every redemption, including JWT client assertion flows.
  • Applying consistent consent and authorization requirements across grant types rather than relying on a particular flow to provide them.
  • Minimizing client privileges and token scopes, and avoiding password-based grants where safer flows are suitable.
  • Treating client metadata and token requests as untrusted, and validating them against server-side policy.

How teams detect issues like this

Review OAuth2 handlers for grant-type checks that are missing, incomplete, or applied only during client registration. Check that disabled-client status is verified across all token redemption paths, including those using JWT client assertions. Monitor authorization and token logs for requests using unregistered grant types, token issuance without expected consent, and redemption attempts by disabled clients. Static analysis and policy checks can help identify inconsistent authorization checks across endpoint implementations.

Sources

SourceLink
github.comgithub.com/openemr/openemr/security/advisories/GHSA-qjj7-c4m9-6f92
vulncheck.comvulncheck.com/advisories/openemr-before-8.5.0-oauth2-grant-type-enforcement-bypass-via-token-endpoint

Frequently asked

questions

It concerns OpenEMR's OAuth2 client grant-type enforcement and certain token flows. Exposure depends on which flows and clients are available in a deployment.

An attacker needs to make requests through the OAuth2 flows and satisfy the applicable client credential or assertion requirements. The precise prerequisites depend on client configuration.

Enforce each client's allowed grant types and enabled status at every relevant authorization and token operation, including authorization-code redemption.

Centralize authorization checks, test each grant flow against client policy and consent requirements, and monitor for token issuance that does not match registered client permissions.

Find out what's already
exploitable in your codebase.