Skip to content

only follow same-origin returnPath after login - #11958

Merged
bhollis merged 1 commit into
DestinyItemManager:masterfrom
dxbjavid:authreturn-open-redirect
Aug 18, 2026
Merged

only follow same-origin returnPath after login#11958
bhollis merged 1 commit into
DestinyItemManager:masterfrom
dxbjavid:authreturn-open-redirect

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

handleAuthReturn finishes the bungie login by pointing the browser at whatever path we stored in localStorage before login, but it never checks the value is one of our own paths. that stored value comes from the pre-login url, so visiting something like app.destinyitemmanager.com//evil.com leaves //evil.com in returnPath, and once the user has authorised it gets treated as a protocol-relative url and quietly sends them off-site. this resolves the stored path against our own origin and only follows it when the origin matches, otherwise falling back to the public path, which also covers the backslash variants browsers normalise to //.

@bhollis
bhollis merged commit aefbe6f into DestinyItemManager:master Aug 18, 2026
4 checks passed
@dxbjavid

Copy link
Copy Markdown
Contributor Author

TY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants