Skip to content

Conversation

@andrzejpiotrowski
Copy link

Redirect URL is not encoded in the redirect_to arg, and it may loose it's own args which will be applied to the parent URL... also the URL with missing args might become invalid, example:

  1. As a logged out user we are entering the page that requires user to be logged in:
    https://mysite.example.com/?p=1234&preview=1&secret=1234

  2. User being redirected to:
    https://mysite.example.com/wp-login.php?redirect_to=https%3A%2F%2Fmysite.example.com%2F%3Fp%3D1234%26preview%3D1%26secret%3D1234

  3. But then the information that is passed to SimpleSAML lib contains already improperly formatted URL, with not encoded redirect_to arg:
    https://mysite.example.com/wp-login.php?redirect_to=https://mysite.example.com/?p=1234&preview=1&secret=1234&action=wp-saml-auth

  4. After all, after successful login, user is redirected to:
    https://mysite.example.com/?p=1234
    but should be to:
    https://mysite.example.com/?p=1234&preview=1&secret=1234

@danielbachhuber danielbachhuber added this to the 0.3.10 milestone Jun 28, 2018
@danielbachhuber danielbachhuber self-requested a review June 28, 2018 14:05
@danielbachhuber danielbachhuber merged commit a6488ea into pantheon-systems:master Jun 28, 2018
@danielbachhuber
Copy link
Contributor

Thanks @andrzejpiotrowski. I've tagged v0.3.10 with this fix.

@andrzejpiotrowski
Copy link
Author

Thank you for quick review!

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