/

CVE-2026-53728

Severity:

HIGH RISK

(7.1)

External Open Redirect (CWE-601) in Medplum IdP Callback

CVE-2026-53728

Deferred

Vulnerability type

Category:

Open Redirect and OAuth Redirect URI Validation

CWE:

CWE-345, CWE-601

Impact:

Cross-Origin Authorization Code Disclosure

Severity:

HIGH RISK

(7.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

Medplum's external identity provider callback may accept a redirect URI that merely begins with a registered URI instead of matching it exactly. An attacker who can influence the callback state may redirect login artifacts, including authorization codes, to an attacker-controlled endpoint when the configured URI can be extended into another origin.

Affected context

The issue occurs in Medplum deployments using the external identity provider login flow. Risk is present when redirect URI validation relies on prefix matching, registered redirect values are broad enough to be extended into another hostname, and callback state can be modified or trusted without sufficient integrity protection.

Exploit preconditions

  • Attack surface: The external identity provider callback at GET /auth/external
  • Required access: The ability to tamper with or influence the serialized login state, or otherwise cause the callback to process an attacker-selected redirect value
  • Trigger point: Successful authentication through the external identity provider
  • Why exploitation is possible: The callback accepts redirect URIs based on a prefix relationship and appends login artifacts to the supplied value without requiring an exact, trusted-origin match

Why this happens

The underlying bug is insufficient redirect URI validation combined with inadequate protection of callback state. Treating a redirect URI as valid because it starts with a registered value can allow a trusted prefix to be extended into a different host or origin. Trusting serialized state without verifying its integrity further permits attacker-controlled redirect data to reach the callback. This behavior maps primarily to CWE-601: URL Redirection to Untrusted Site, with CWE-345: Insufficient Verification of Data Authenticity also relevant to the state-handling weakness.

Potential impact

  • An attacker could redirect authorization codes or login artifacts to an external endpoint
  • User accounts or sessions could be exposed if leaked artifacts are usable
  • OAuth or external identity provider flows could be redirected across origins
  • The issue may enable account compromise depending on artifact validity and downstream protections

General mitigation guidance

Mitigation generally focuses on enforcing exact redirect URI registration and protecting the integrity of authentication state.

Common defensive patterns include:

  • Require exact, canonical redirect URI matches rather than prefix or substring comparisons
  • Bind redirect destinations to an allowlist of complete schemes, hosts, ports, and paths
  • Reject redirects that cross the intended origin or contain ambiguous URL parsing forms
  • Authenticate or cryptographically protect serialized state and validate it before use
  • Avoid placing authorization artifacts in attacker-influenced destinations
  • Apply least privilege and short lifetimes to authorization codes and related tokens

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review checks for startsWith, prefix, substring, or loosely normalized redirect URI comparisons
  • Review of OAuth and external-login callbacks for state integrity validation
  • Tests using sibling hostnames, alternate ports, encoded characters, and path extensions
  • Policy enforcement requiring exact redirect URI allowlists and same-origin validation
  • Monitoring for authentication callbacks that redirect to domains outside the approved identity application set

Automated security testing and code review tools can help identify weak redirect validation and unprotected state handling.

Sources

SourceLink
github.comgithub.com/medplum/medplum/commit/7ae10035ddadde4dba7b18d3156553940465b3a1
github.comgithub.com/medplum/medplum/pull/8749
github.comgithub.com/medplum/medplum/releases/tag/v5.1.6
github.comgithub.com/medplum/medplum/security/advisories/GHSA-m44r-7c5h-m6mj

Frequently asked

questions

It may be exploitable through the external authentication flow when an attacker can influence callback state or redirect parameters and the deployment uses a permissive redirect configuration.

Not necessarily. The flow is reached during login, but exploitation depends on the attacker's ability to influence state or initiate a crafted authentication request and on the deployment's redirect configuration.

Validate redirect URIs using exact canonical allowlist matches, enforce same-origin expectations, and cryptographically bind callback state to the original authentication request.

Use strict OAuth redirect URI policies, treat serialized state as untrusted until verified, test cross-origin edge cases, and monitor authentication redirects for unexpected destinations.

Find out what's already
exploitable in your codebase.