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

refactor(login): validate same origin for redirect target url after login #181

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

emmenko
Copy link
Member

@emmenko emmenko commented Dec 5, 2018

To prevent possible unwanted redirects to 3rd party "malicious" websites after the user logs in, we should check that the redirectTo query parameter matches the current Origin.
So if you're in https://mc.commercetools.com/login, the redirectTo is valid if it contains the same origin https://mc.commercetools.com (e.g. https://mc.commercetools.com/my-project/orders).

To make the validation possible, the redirectTo now contains the origin, where previously it only contained the uri path.

@emmenko emmenko added 🙏 Status: Dev Review Waiting for technical reviews 💅 Type: Enhancement Improves existing code labels Dec 5, 2018
@emmenko emmenko requested a review from tdeekens December 5, 2018 07:42
@emmenko emmenko merged commit 95f4ff6 into master Dec 5, 2018
@emmenko emmenko deleted the nm-validate-redirect-to-url-after-login branch December 5, 2018 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 Status: Dev Review Waiting for technical reviews 💅 Type: Enhancement Improves existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants