-
Notifications
You must be signed in to change notification settings - Fork 64
[PEGASUS-935] Redirect to default unauthorised zendesk url when SSO is disabled #159
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
Merged
yoshdog
merged 2 commits into
master
from
PEGASUS-935-investigate-reported-sso-open-redirect-vulnerabili
Jul 2, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is meant to be decoding. Usually you would be taking the raw value and when adding it back to the URL below you would encode it.
Currently you could add additional query parameters to the resulting URL going to Zendesk due to lack of encoding and the manual query building. Probably benign but doesn’t seem intentional.
I would recommend http_build_query below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @driskell
is your comment in relation to lines 79 - 81?
https://github.com/zendesk/magento_extension/pull/159/files#diff-d8d07556aac1f9945f929f9079d3f0afR79-R81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging this as is... happy to look into this in a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the return URL could contain ampersand. In which case rather than being elements of the return url they would become additional query parameters sent to the JWT endpoint. So could cause undesired behaviour.
For example If url is: http://hello/something?query&something=more
The resulting url in the redirect becomes:
https://zendeskdomain/access/jwt?jwt=accesstoken&return_to=http://hello/something?query&something=more
So not only not encoded but the final part won’t be part of the return_to and will be stripped when the return happens.
Can’t see if causing an issue except maybe breaking some return URLs. But I don’t know what parameters that endpoint accepts.