-
Notifications
You must be signed in to change notification settings - Fork 13
Fix Cursor OAuth callback handoff hanging on "waiting for callback" #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -229,12 +229,15 @@ func (s *OAuthServer) HandleCallback(w http.ResponseWriter, r *http.Request) { | |
| // navigates to a clean /auth/complete URL with no sensitive parameters. | ||
| completionToken := s.store.StoreCompletion(redirectURL.String()) | ||
|
|
||
| s.logger.Info("authentication successful, redirecting to client", "client_id", safePrefix(pending.ClientID)) | ||
| s.logger.Info("authentication successful, redirecting to client", | ||
| "client_id", safePrefix(pending.ClientID), | ||
| "client_redirect", pending.RedirectURI, | ||
| ) | ||
|
Comment on lines
+232
to
+235
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Redact the redirect URI in the Info log.
🤖 Prompt for AI Agents |
||
| http.Redirect(w, r, "/auth/complete/"+completionToken, http.StatusFound) | ||
| } | ||
|
|
||
| // HandleComplete serves the post-authentication success page at a clean URL | ||
| // with no OAuth parameters exposed. It renders a meta-refresh redirect to the | ||
| // with no OAuth parameters exposed. It renders a JS-redirect page to the | ||
| // MCP client's redirect_uri. | ||
| // GET /auth/complete/{token} | ||
| func (s *OAuthServer) HandleComplete(w http.ResponseWriter, r *http.Request) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 22908
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 50403
🏁 Script executed:
Repository: redhat-data-and-ai/unstructured-data-controller
Length of output: 485
Restrict redirect URI schemes before storing clients.
HandleAuthorizestores only registered URIs, and registration rejectsjavascript,data,blob, andvbscript. However, registration still accepts arbitrary schemes such asftp://andcustom://.template.URLthen bypasses scheme filtering, andHandleCompletesends these URIs to bothhrefandwindow.location.replace. Allow onlycursor://and loopback callback URIs.🤖 Prompt for AI Agents