-
Notifications
You must be signed in to change notification settings - Fork 899
fix: relax csrf to exclude path based apps #11430
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
+151
−2
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
658d7df
fix: relax csrf to exclude path based apps
Emyrk fe4e2ba
add unit test to verify path based apps are not CSRF blocked
Emyrk f2e615d
testing needs to be parallel
Emyrk a4bbc80
Linting
Emyrk 63133cf
Merge remote-tracking branch 'origin/main' into stevenmasley/relax_csrf
Emyrk 3828354
Merge remote-tracking branch 'origin/main' into stevenmasley/relax_csrf
Emyrk c6c4141
Try exempting first user
Emyrk 42a3021
Merge remote-tracking branch 'origin/main' into stevenmasley/relax_csrf
Emyrk 043c79d
we need to add csrf mw to set cookie
Emyrk 388e56e
add comment
Emyrk fee870b
add unit tests
Emyrk 6966f87
Linting
Emyrk 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
Next
Next commit
fix: relax csrf to exclude path based apps
- Loading branch information
commit 658d7df3a66d5783646c5078e98ced09e878bbda
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
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.
There are a bunch of
ExemptRegexp()
calls inside this middleware that may need to be reviewed after this change. It might be nicer to have those passed explicitly as arguments tohttpmw.CSRF
instead of being hidden inside the middleware.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.
The thing is, this will pretty quickly fail on someone when they add a new route if it breaks. The error is a CSRF error, which brings you to here. I prefer to have this all in 1 place, and this should never be configurable by a customer except maybe to disable it entirely.
I think the current exempts are overkill. I intentionally went a bit overkill because I was afraid of breaking anything. Some
The reason there are exempts like this is when I turned this back on, I was trying to error on the side of caution. I think we should have a PR to remove an exempt 1 by 1 when we determine they can never cause an issue.
An example is the
/provisionerdaemons
ones. They are currently only GET requests, and I do not think the actual daemons are using cookies to authenticate. However I error-ed on the side of caution since these routes should never use CSRF anyway.I can make follow up PRs to drop these with rational for each one