-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(AppFramework): Correctly implement CSRF checks #43699
Conversation
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.
Seems to break cypress?
Code looks good but I do not know the situation well enough to say if it’s okay to require only one method to pass. |
978b2c2
to
5fca3cc
Compare
I rewrote this PR from scratch with the new information I had. This should be much easier to review. The main problem before was concerning the cookie checks which I didn't understand correctly, but now I also added documentation for the next people who will look at it... |
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.
In the end what is the behavior change brought by this PR?
It allows using the OCS-APIRequest header to bypass CSRF checks. For clients this is necessary, so they don't have to deal with CSRF tokens. Both methods are safe, but the former was not possible until now. |
So nothing for 29 during freeze 🙊 |
I guess so :/ |
Since the branch-off is done, can I get reviews to get it into Nextcloud 30? |
@nickvergessen @ChristophWurst Can I get your reviews? |
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
…CSRF checks Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
5fca3cc
to
22a6959
Compare
22a6959
to
a77ef60
Compare
I made a minimal version of these changes that only include the actual fix and leaves out all the refactoring and documentation: #46760 |
Summary
These changes ensure that actually all the CSRF protection methods can be correctly used.
I improved the existing codes and allowed requests with OCS-APIRequest headers to pass which was not possible before and a bug.
As far as I can see there were no security problems before and this does not open any new ones ™️
Checklist