Fix/validate urls for http/https scheme only in auth flow#740
Merged
Fix/validate urls for http/https scheme only in auth flow#740
Conversation
- Create shared validateRedirectUrl utility to centralize URL validation - Only allow HTTP and HTTPS protocols in OAuth authorization URLs - Fix three vulnerable redirect paths that bypassed validation: - AuthDebugger.tsx: Direct window.location.href redirect - OAuthFlowProgress.tsx: window.open() without validation - OAuthFlowProgress.tsx: Direct anchor href attribute - Add comprehensive test coverage for URL validation - Update existing auth.ts to use shared validation utility This prevents malicious MCP servers from injecting javascript: or data: protocol URLs that would execute XSS attacks when users are redirected to the authorization endpoint. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Contributor
🎭 Playwright E2E Test Results✅ 24 passed Details24 tests across 3 suites 📊 View Detailed HTML Report (download artifacts) |
cliffhall
approved these changes
Aug 21, 2025
Member
cliffhall
left a comment
There was a problem hiding this comment.
LGTM! 👍
Tested locally, and the OAuth flow problems identified earlier have been fixed with the provided change. Code looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
We recently added scheme validation to authorization urls. #687
This pulls the validation out into a shared helper and applies it in a few more places:
- A window.open() call without validation
- A direct anchor href attribute without validation
How Has This Been Tested?
With the oauth debugger and the typescript SDK (thanks @cliffhall 🙌)
Breaking Changes
I don't think this should break anything, just validate that we're using the expected schemes.
Types of changes
Checklist