Title: Validate DCR redirect_uris with HTTPS-or-loopback policy by KirtiRamchandani · Pull Request #2860 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Validate DCR redirect_uris with HTTPS-or-loopback policy by KirtiRamchandani · Pull Request #2860 · modelcontextprotocol/python-sdk
X Title: Validate DCR redirect_uris with HTTPS-or-loopback policy by KirtiRamchandani · Pull Request #2860 · modelcontextprotocol/python-sdk
Description: Problem Dynamic client registration accepts dangerous redirect_uris such as javascript:, data:, file:, cleartext non-loopback http://, and URIs with fragments. The SDK already enforces an HTTPS-or-loopback policy for issuer URLs, but DCR did not apply the same checks. Root cause RegistrationHandler passed client-submitted redirect_uris straight through after Pydantic URL parsing. AnyUrl accepts any syntactically valid scheme. Fix Add validate_registered_redirect_uri() alongside the existing issuer URL validator Reject unsafe schemes, non-loopback HTTP, and fragment-bearing redirect URIs during /register Return invalid_client_metadata when validation fails Testing Extended tests/server/auth/test_routes.py python3 -m pytest tests/server/auth/test_routes.py -q --confcutdir=tests/server/auth Fixes #2629
Open Graph Description: Problem Dynamic client registration accepts dangerous redirect_uris such as javascript:, data:, file:, cleartext non-loopback http://, and URIs with fragments. The SDK already enforces an HTTPS-or-...
X Description: Problem Dynamic client registration accepts dangerous redirect_uris such as javascript:, data:, file:, cleartext non-loopback http://, and URIs with fragments. The SDK already enforces an HTTPS-or-...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2860
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:db0f3237-f20c-e123-79db-3a565e31364f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BE70:ACCAF:25BCC28:32E6EA2:6A59B758 |
| html-safe-nonce | 734f9f0e5c9c5b31fb70f9730c0b7372ccfd0e7c19a0f8d27d4f9540d710900d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTcwOkFDQ0FGOjI1QkNDMjg6MzJFNkVBMjo2QTU5Qjc1OCIsInZpc2l0b3JfaWQiOiI2OTIyMTYxNTI4NDg5NzE2MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b52093fbf51d20788641894455ef546fbbad1fa4ada6deb3b72357e1d54f4687 |
| hovercard-subject-tag | pull_request:3860803894 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2860/files |
| twitter:image | https://avatars.githubusercontent.com/u/33368817?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/33368817?s=400&v=4 |
| og:image:alt | Problem Dynamic client registration accepts dangerous redirect_uris such as javascript:, data:, file:, cleartext non-loopback http://, and URIs with fragments. The SDK already enforces an HTTPS-or-... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab680789ae4a316cdaf0d5a292a1760140931cc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width