Fix session fixation attack - #8759
Merged
Merged
Conversation
📊 Coverage Report
|
kevinpschaaf
left a comment
Collaborator
There was a problem hiding this comment.
Looks good!
I think you want this PR targeting the opal-eol branch though, per Tim's setup.
Let's also get @aomarks and @timswanson-google 's reviews
timswanson-google
approved these changes
Aug 11, 2026
aomarks
approved these changes
Aug 11, 2026
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.
Fix session fixation vulnerability in OAuth connection flow
Summary
Mitigates an OAuth session fixation attack by deferring the token grant request (
/connection/grant/) until after the opener window has verified thenonceagainst its local session state. In addition, migrates the/grantAPI endpoint fromGETtoPOSTwith a JSON payload for defense-in-depth.Key Changes
1. Defer Token Exchange to Opener Tab
packages/visual-editor/src/ui/elements/connection/connection-broker.ts:/grantfetch from the popup window.ConnectionBrokernow relays the raw authorizationcode,nonce,redirectPath,scopes, andauthusertowindow.openerviapostMessage.packages/visual-editor/src/ui/utils/oauth-based-opal-shell.ts:#listenForSignIn, the opener tab verifies thatpopupMessage.nonce === noncebefore making the network request to/connection/grant/.POSTrequest with{ code, redirect_path }JSON payload to exchange the authorization code for tokens.2. Migrate
/grantEndpoint toPOSTpackages/unified-server/src/connection/server.ts:/grantroute fromGETtoPOST.express.json()middleware.packages/unified-server/src/connection/api/grant.ts:grant()handler to read request parameters fromreq.body(while maintaining fallback parsing from query parameters).3. Update OAuth Message Types
packages/types/src/oauth.ts:OAuthPopupPayloaddiscriminated union type.OAuthPopupMessageto carry the payload containing the authorization code and nonce (or error).