-
Notifications
You must be signed in to change notification settings - Fork 156
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
Revalidate two factor settings prior to allowing any two-factor changes to an account. #529
Merged
dd32
merged 57 commits into
WordPress:master
from
dd32:add/2fa-revalidation-for-changes
May 11, 2023
Merged
Revalidate two factor settings prior to allowing any two-factor changes to an account. #529
dd32
merged 57 commits into
WordPress:master
from
dd32:add/2fa-revalidation-for-changes
May 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n session & 2FA times.
…ndary method for re-use.
…rently logged in with, not their primary method.
… these are not fields that need sanitization. Either they match an expected value or they don't.
…returning truthful, this closer matches the expectation from other providers.
…he interim-login parameter is passed through.
…the current user.
…pdate 2FA options.
…ed=disabled> when appropriate
…it disables with :disabled
iandunn
approved these changes
Apr 21, 2023
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.
This looks great, kudos!
Increasing the test coverage would be nice, but not necessarily a blocker.
Co-authored-by: Ian Dunn <[email protected]>
Co-authored-by: Ian Dunn <[email protected]>
…to avoid needing to revalidate the session immediately.
…e_two_factor_options().
…actor_options() if the user isn't logged in. This function doesn't check capabilities, but should not return truthful for logged out users.
Changes in the commits above that are notable since reviews:
|
ravinderk
approved these changes
May 2, 2023
2 tasks
… site_url function if known.
This was referenced May 12, 2023
This was referenced Apr 23, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR requires that the user "revalidate" their two-factor details prior to changing their two-factor settings.
The grace-time from last-2fa-validation to changes is 10 minutes (Twice this for the save, so you can start editing at minute 9, and save at 18 minutes).
Why?
It's generally accepted that a user should not be able to change their 2FA settings without validating that the user currently has their 2FA token.
For example, consider an account left logged in on a public computer (or left unattended in an office), a malicious user should not be able to add a new key or create new backup codes.
How?
This works by building off #528 to track when the user last validated their 2FA tokens, and preventing updates unless the session is 2fa'd recently.
Testing Instructions
two_factor_revalidate_time
to a lower time)Screenshots or screencast
Changelog Entry
Added Security - Validate the user has access to their 2FA keys prior to changing 2FA details.
Tickets
Fixes #484.
#527 and #528 have been split out of this, but are included in the git commit history of this branch.