-
Notifications
You must be signed in to change notification settings - Fork 228
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 issue #40 #56
Fix issue #40 #56
Conversation
…_reset_page_access_counter.
…_reset_page_access_counter
…ter and #reset_password_reset_page_access_counter.
@athix The risk:
Considering these points, barring the leak is achieved by the restriction of one time access. The restriction of one time access is:
I think it is the better way to prevent the leak, and I would appreciate if you move on to reviewing my codes. |
@athix |
@Ch4s3 do you have the time to review/merge this? I probably won't be able to get to it for at least a couple weeks. |
@athix and @ebihara99999 this looks good. I'll merge it once I have some time to update the docs. |
Change manual increment into using Sorcery::Adapters::ActiveRecordAdapter.increment.
I'll try to merge this tonight |
Fix Password reset token leak via HTTP referer.
This change requires to update the documentation accordingly, and I will explain how to fix it in implementation and the documentation (written below).
Implementation
I follow the step of the first direction mentioned in Is Your Site Leaking Password Reset Links?:
In
lib/sorcery/model/submodules/reset_password.rb
,#increment_password_reset_page_access_counter
, which increments access_count_to_reset_password_page attribute.#reset_password_reset_page_access_counter
. This resets access_count_to_reset_password_page attribute to 0I will explain how these changes affect the password reset feature in a rails application below.
Documentation
The wiki is expected to update as follows only
PasswordResetsController#create
andPasswordResetsController#edit
:Testing
Sorcery
All specs are green.
Documentation
Test the steps mentioned in Is Your Site Leaking Password Reset Links?, confirming the second access is invalid.