-
Notifications
You must be signed in to change notification settings - Fork 68
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
(PXP-7565): Exclude Fence register-user blueprint from CSRF check #1580
Merged
Conversation
This file contains 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
jawadqur
approved these changes
Apr 26, 2021
This was referenced Sep 7, 2021
Closed
This was referenced Sep 14, 2021
This was referenced Nov 23, 2021
This was referenced Dec 10, 2021
This was referenced Mar 7, 2022
This was referenced Mar 21, 2022
This was referenced Mar 29, 2022
This was referenced Apr 30, 2022
This was referenced Jun 23, 2022
This was referenced Dec 18, 2023
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TLDR:
The revproxy currently implements CSRF checks using the cookie-to-header method.
Fence's new registration form, like other HTML forms, is not compatible with this method. The usual way to implement CSRF protection with HTML forms is using a hidden form field.
So here we exclude the Fence registration endpoints from the revproxy CSRF check. This is OK because Fence implements its own CSRF checks.
Here is the relevant Fence PR (implementing registration endpoints) uc-cdis/fence#906
For the record, more background on cloud-auto CSRF history:
Fence has been operating under the assumption that it manages its own CSRF token.
But actually the revproxy rewrites the token and performs its own CSRF checking.
At time of PR, the revproxy CSRF check looks like this.
That code can be traced back to this commit and this commit.
At some point between then and now, the "return 403 failed csrf check" bit migrated from the main nginx.conf into the individual *-service.conf files.
Jira Ticket: PXP-7565
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes