-
Notifications
You must be signed in to change notification settings - Fork 9
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
IBX-833: As a Developer I want to configure CSRF validation in REST endpoints #76
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -143,6 +147,8 @@ protected function isLoginRequest($route) | |||
* @param string $route | |||
* | |||
* @return bool | |||
* | |||
* @deprecated since Ibexa DXP 3.3.7. Add csrf_protection: false attribute to route definition instead. |
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.
Can we use trigger_deprecation
from Symfony contracts to log situations where isSessionRoute
returns true? Does it make sense?
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.
Q: doesn't this open us to potential security issue?
No, CSRF protection is enabled by default for all POST/PUT/etc endpoints. If you needs to disable CSRF protection (in mentioned use case is required) then you must configure it explicitly. |
My question was rather about is it safe to disable that for session endpoints? |
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.
Clarified during internal sync.
Allow to configure CSRF validation in REST endpoints using
attribute in route definition.
Currently to achive the same efect
\EzSystems\EzPlatformRestBundle\EventListener\CsrfListener::isSessionRoute
needs to be overriden:Example use cases:
TODO:
$ composer fix-cs
).