René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:db0f3237-f20c-e123-79db-3a565e31364f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE70:ACCAF:25BCC28:32E6EA2:6A59B758
html-safe-nonce734f9f0e5c9c5b31fb70f9730c0b7372ccfd0e7c19a0f8d27d4f9540d710900d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTcwOkFDQ0FGOjI1QkNDMjg6MzJFNkVBMjo2QTU5Qjc1OCIsInZpc2l0b3JfaWQiOiI2OTIyMTYxNTI4NDg5NzE2MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb52093fbf51d20788641894455ef546fbbad1fa4ada6deb3b72357e1d54f4687
hovercard-subject-tagpull_request:3860803894
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2860/files
twitter:imagehttps://avatars.githubusercontent.com/u/33368817?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/33368817?s=400&v=4
og:image:altProblem 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseab680789ae4a316cdaf0d5a292a1760140931cc4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2860%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fpull%2F2860%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Reloadhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
modelcontextprotocol https://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Fork 3.7k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Star 23.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk
Code https://github.com/modelcontextprotocol/python-sdk
Issues 255 https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests 303 https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality 6 https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Code https://github.com/modelcontextprotocol/python-sdk
Issues https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests https://github.com/modelcontextprotocol/python-sdk/pulls
Actions https://github.com/modelcontextprotocol/python-sdk/actions
Projects https://github.com/modelcontextprotocol/python-sdk/projects
Models https://github.com/modelcontextprotocol/python-sdk/models
Security and quality https://github.com/modelcontextprotocol/python-sdk/security
Insights https://github.com/modelcontextprotocol/python-sdk/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2Fnew%2Fchoose
KirtiRamchandanihttps://github.com/KirtiRamchandani
modelcontextprotocol:mainhttps://github.com/modelcontextprotocol/python-sdk/tree/main
KirtiRamchandani:fix/dcr-redirect-uri-validationhttps://github.com/KirtiRamchandani/python-sdk/tree/fix/dcr-redirect-uri-validation
Conversation 0 https://github.com/modelcontextprotocol/python-sdk/pull/2860
Commits 1 https://github.com/modelcontextprotocol/python-sdk/pull/2860/commits
Checks 27 https://github.com/modelcontextprotocol/python-sdk/pull/2860/checks
Files changed https://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Validate DCR redirect_uris with HTTPS-or-loopback policy https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#top
Show all changes 1 commit https://github.com/modelcontextprotocol/python-sdk/pull/2860/files
55187a0 Validate DCR redirect_uris with HTTPS-or-loopback policy KirtiRamchandani Jun 14, 2026 https://github.com/modelcontextprotocol/python-sdk/pull/2860/commits/55187a073180bda1b69992cfe93e5413d0abdb66
Clear filters https://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
register.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
routes.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6dfb076f1d9772b9a78be06b88bbbae0f92a0108284fcf247f342cd1a88433f2
validation.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-e1224549f9347c848c7b8975f6d599fd00637148fc8f20987ed331490b64b663
_requirements.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
test_as_handlers.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-276fddce310f4eebd30cd9e80e00a793954284aa79132c556f1f4992c14fb85a
test_routes.py https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
src/mcp/server/auth/handlers/register.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/src/mcp/server/auth/handlers/register.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6643f748c6f203d6b3c55593361c894373aa78f360ebaa4f3b60b445efccc5af
src/mcp/server/auth/routes.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6dfb076f1d9772b9a78be06b88bbbae0f92a0108284fcf247f342cd1a88433f2
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/src/mcp/server/auth/routes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6dfb076f1d9772b9a78be06b88bbbae0f92a0108284fcf247f342cd1a88433f2
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-6dfb076f1d9772b9a78be06b88bbbae0f92a0108284fcf247f342cd1a88433f2
src/mcp/server/auth/validation.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-e1224549f9347c848c7b8975f6d599fd00637148fc8f20987ed331490b64b663
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/src/mcp/server/auth/validation.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
tests/interaction/_requirements.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/tests/interaction/_requirements.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-c12ce54cbf13a11daa3f93343e5df8c89ca2b25d0f20f00b5408a2402a223228
tests/interaction/auth/test_as_handlers.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-276fddce310f4eebd30cd9e80e00a793954284aa79132c556f1f4992c14fb85a
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/tests/interaction/auth/test_as_handlers.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-276fddce310f4eebd30cd9e80e00a793954284aa79132c556f1f4992c14fb85a
tests/server/auth/test_routes.pyhttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
View file https://github.com/modelcontextprotocol/python-sdk/blob/55187a073180bda1b69992cfe93e5413d0abdb66/tests/server/auth/test_routes.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/modelcontextprotocol/python-sdk/pull/2860/{{ revealButtonHref }}
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
https://github.com/modelcontextprotocol/python-sdk/pull/2860/files#diff-bc60cb989fbbc80ad7d8060a2d4e94eb842ae941dde869cb293a9bd94c452ba9
Please reload this pagehttps://github.com/modelcontextprotocol/python-sdk/pull/2860/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.