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

(PXP-7565): Exclude Fence register-user blueprint from CSRF check #1580

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

vpsx
Copy link
Contributor

@vpsx vpsx commented Apr 19, 2021

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

@vpsx vpsx merged commit fb77af1 into master Apr 26, 2021
@vpsx vpsx deleted the fix/register-bp-no-csrf branch April 26, 2021 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants