-
Notifications
You must be signed in to change notification settings - Fork 35
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
Implement endpoint csrf protection #2057
Implement endpoint csrf protection #2057
Conversation
…aviour based on token pool
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 PR diff size of 6147 lines exceeds the maximum allowed for the inline comments feature.
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 PR diff size of 6278 lines exceeds the maximum allowed for the inline comments feature.
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 PR diff size of 6278 lines exceeds the maximum allowed for the inline comments feature.
Any reason why the HTTP response has a |
@martijn-tao @siwane could you comment? I didn't catch the exact details of why we changed it. |
|
||
/** @var TokenStore $tokenStore */ | ||
$tokenStore = $tokenService->getOption(TokenService::OPTION_STORE); | ||
$tokenStore->removeTokens(); |
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.
for my own understanding, what the purpose of removing the tokens during an update ?
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.
Still very minor issues regarding the source code, but the overall looks very good !
I've made some testing of the back-office and the test runner which looks working as expected.
I've only encountered one issue on taoDacSimple, which is most likely related to the call of the request itself (so the error belong to that extension) : oat-sa/extension-tao-dac-simple#87 (review)
…ttps://github.com/oat-sa/tao-core into feature/TAO-7306-Implement-endpoint-CSRF-protection
And by the way the status code |
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 PR diff size of 6257 lines exceeds the maximum allowed for the inline comments feature.
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.
Code is ok now from my perspective.
I didn't found any other issue
…ttps://github.com/oat-sa/tao-core into feature/TAO-7306-Implement-endpoint-CSRF-protection
@krampstudio Done, Changed the status to 403 |
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 PR diff size of 6257 lines exceeds the maximum allowed for the inline comments feature.
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 PR diff size of 6257 lines exceeds the maximum allowed for the inline comments feature.
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 PR diff size of 6257 lines exceeds the maximum allowed for the inline comments feature.
This PR now contains all the work for:
https://oat-sa.atlassian.net/browse/TAO-7304
https://oat-sa.atlassian.net/browse/TAO-7305
https://oat-sa.atlassian.net/browse/TAO-7306
Description
7304 (Backend part):
try { $this->validateCsrf(); } catch(\common_exception_Unauthorized $e) { ... }
block[FormContainer::CSRF_PROTECTION_OPTION => true]
to the form options.$form->isValid()
check offers protection.7305 (Frontend part):
7306 (Implementation in TAO):
A more comprehensive view of protected forms and endpoints is being documented here:
https://docs.google.com/spreadsheets/d/1TaXQDKcemsIjbWPzCvzyLsU1_EyH8MJ3vKW_-r4iZz0
To test:
Related PRs: