Skip to content
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

Open redirect bug crashes the app #577

Open
FlorianCassayre opened this issue Apr 3, 2023 · 0 comments
Open

Open redirect bug crashes the app #577

FlorianCassayre opened this issue Apr 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@FlorianCassayre
Copy link
Member

Package version (if known): 1.0.0-alpha.75 (latest at present time)

Describe the bug

The app attempts to push a URL with a different origin to the history, which is illegal (luckily in this case), and thus crashes the app.

Steps to Reproduce

  1. Navigate to https://catalogue.library.cern/login?next=/%09/example.com (the login page, but with a special payload in the query parameters)
  2. Sign in
  3. After the redirection the browser shows a blank page. Devtools logged the following error:
DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'https://example.com/' cannot be created in a document with origin 'https://catalogue.library.cern' and URL 'https://catalogue.library.cern/login?message=Successfully+authorized.&code=200&next_url=%2F%2509%2Fexample.com'.

Expected behavior

The app should not crash nor attempt to redirect to a different origin, regardless the provided redirection parameter.

Additional context

Notice how //example.com or https%3A//example.com don't work, but /%09/example.com does. %09 stands for encoded tabulation.

@FlorianCassayre FlorianCassayre added the bug Something isn't working label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant