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

Disable CSRF checks on some most-used forms #1136

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Conversation

melroy89
Copy link
Member

@melroy89 melroy89 commented Sep 19, 2024

We see a lot of issues with CSRF in your forms with Mbin... We disable CSRF checks for now on the forms that doesn't have actions that seems very harmful, even if it would be exploited by a CSRF attack..

Especially on the following CSRF IDs:

  • up_vote
  • down_vote
  • boost
  • subscribe
  • block
  • clear_notifications
  • read_notifications
  • follow

Since the impact on CSRF attacks on these kind of actions are minimal and slim. I will disable the validate check for now in the controller code. Until we fully have resolved this issue, since it affects a lot of people!

This is trying to resolve bullet 13th at: #1119

@melroy89 melroy89 added enhancement New feature or request php Pull requests that update PHP code frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end backend Backend related issues and pull requests security Issues and pull requests that address security concerns labels Sep 19, 2024
@melroy89 melroy89 added this to the v1.7.2 milestone Sep 19, 2024
@melroy89
Copy link
Member Author

I think we can safely say this PR is a great success. 👍🏽

@melroy89 melroy89 enabled auto-merge (squash) September 20, 2024 13:52
Copy link
Member

@BentiGorlich BentiGorlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should link this PR or the CSRF issue if we have on in the comments, so we can get the context of the problems. Additionally should the csrf token not also be removed on the forms? Or do you really just want to disable the verification of the tokens?

@melroy89
Copy link
Member Author

I think you should link this PR or the CSRF issue if we have on in the comments, so we can get the context of the problems.

I can add indeed this PR number.

Additionally should the csrf token not also be removed on the forms? Or do you really just want to disable the verification of the tokens?

Officially we could remove all the CSRF code from the controller & twig templates if we really want to indeed. However, my aim was to "temporally" (for the foreseeable future) the CSRF checks on the less critical areas, solving the 500 errors and improve the user experience overall. Until we know how to better solve the issue... (if at all).

@melroy89
Copy link
Member Author

I can add indeed this PR number.

Done!

@melroy89 melroy89 merged commit b744109 into main Sep 20, 2024
7 checks passed
@melroy89 melroy89 deleted the remove_csrf_from_forms branch September 20, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests enhancement New feature or request frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end php Pull requests that update PHP code security Issues and pull requests that address security concerns
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants