Core: Medplum: Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage (CVE-2026-53728)
Medplum versions prior to 5.1.6 contain a vulnerability in the external identity provider callback at GET /auth/external, where redirect URIs are improperly validated using a prefix match instead of an exact match. This allows an attacker to supply a malicious redirect URI that starts with a registered URI but points to an attacker-controlled domain, causing authorization codes to be leaked via redirection. The vulnerability enables an attacker to intercept authorization codes and potentially perform a full account takeover of users authenticating via the external IdP flow.
AI Analysis
Technical Summary
The vulnerability exists in Medplum's external authentication callback handler, which accepts redirect URIs that only need to start with a registered client redirect URI rather than matching exactly. The server appends authorization artifacts (login and code) to the attacker-controlled redirect URI and issues a redirect. Because the state parameter is serialized as raw JSON and can be tampered with, an attacker can supply a redirect URI that prefixes a registered URI but points to a different origin, resulting in cross-origin leakage of authorization codes. The exact-match check is only used for logging and does not prevent the redirect. This flaw allows an attacker to capture authorization codes and redeem them if the PKCE verifier is known, leading to full account takeover.
Potential Impact
This vulnerability has a high impact as it enables an attacker to leak authorization codes to an attacker-controlled endpoint by exploiting improper redirect URI validation. Successful exploitation can lead to full account takeover (ATO) of users authenticating via the external identity provider flow, compromising confidentiality and integrity of user accounts. The CVSS score is 7.1 (High), reflecting network attack vector with high confidentiality and integrity impact but requiring user interaction and high attack complexity.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade Medplum to version 5.1.6 or later, where the redirect URI validation enforces exact matching rather than prefix matching. Until patched, avoid registering redirect URIs that can be prefix-matched and extended into attacker-controlled domains. Review client redirect URI configurations to ensure they do not allow prefix overlaps with untrusted domains. Patch status is confirmed as a fix is available.
Core: Medplum: Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage (CVE-2026-53728)
Description
Medplum versions prior to 5.1.6 contain a vulnerability in the external identity provider callback at GET /auth/external, where redirect URIs are improperly validated using a prefix match instead of an exact match. This allows an attacker to supply a malicious redirect URI that starts with a registered URI but points to an attacker-controlled domain, causing authorization codes to be leaked via redirection. The vulnerability enables an attacker to intercept authorization codes and potentially perform a full account takeover of users authenticating via the external IdP flow.
CVSS v3.1
Score 7.1high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in Medplum's external authentication callback handler, which accepts redirect URIs that only need to start with a registered client redirect URI rather than matching exactly. The server appends authorization artifacts (login and code) to the attacker-controlled redirect URI and issues a redirect. Because the state parameter is serialized as raw JSON and can be tampered with, an attacker can supply a redirect URI that prefixes a registered URI but points to a different origin, resulting in cross-origin leakage of authorization codes. The exact-match check is only used for logging and does not prevent the redirect. This flaw allows an attacker to capture authorization codes and redeem them if the PKCE verifier is known, leading to full account takeover.
Potential Impact
This vulnerability has a high impact as it enables an attacker to leak authorization codes to an attacker-controlled endpoint by exploiting improper redirect URI validation. Successful exploitation can lead to full account takeover (ATO) of users authenticating via the external identity provider flow, compromising confidentiality and integrity of user accounts. The CVSS score is 7.1 (High), reflecting network attack vector with high confidentiality and integrity impact but requiring user interaction and high attack complexity.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade Medplum to version 5.1.6 or later, where the redirect URI validation enforces exact matching rather than prefix matching. Until patched, avoid registering redirect URIs that can be prefix-matched and extended into attacker-controlled domains. Review client redirect URI configurations to ensure they do not allow prefix overlaps with untrusted domains. Patch status is confirmed as a fix is available.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-m44r-7c5h-m6mj
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-53728"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a833354bf8831d5392a4dee
Added to database: 08/17/2026, 16:14:12 UTC
Last enriched: 08/17/2026, 16:27:33 UTC
Last updated: 08/17/2026, 22:06:38 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.