Skip to content

RFD 158: Description of how we should address a targeted account auth DoS#35533

Merged
jentfoo merged 4 commits intomasterfrom
rfd/0158-account-recovery
Jan 9, 2024
Merged

RFD 158: Description of how we should address a targeted account auth DoS#35533
jentfoo merged 4 commits intomasterfrom
rfd/0158-account-recovery

Conversation

@jentfoo
Copy link
Copy Markdown
Contributor

@jentfoo jentfoo commented Dec 8, 2023

This RFD describes how we should address the security issue captured in https://github.com/gravitational/security-findings/issues/75

The removal of this feature is already available as a PR under: #35325

@jentfoo jentfoo added the rfd Request for Discussion label Dec 8, 2023
@jentfoo jentfoo self-assigned this Dec 8, 2023
@github-actions github-actions Bot requested a review from zmb3 December 8, 2023 00:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 8, 2023

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 8, 2023

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@jentfoo jentfoo added the no-changelog Indicates that a PR does not require a changelog entry label Dec 8, 2023
@jentfoo jentfoo changed the title RFD: Description of how we should address a targeted account DoS RFD: Description of how we should address a targeted account auth DoS Dec 8, 2023
@jentfoo jentfoo changed the title RFD: Description of how we should address a targeted account auth DoS RFD 158: Description of how we should address a targeted account auth DoS Dec 8, 2023
Copy link
Copy Markdown
Contributor

@klizhentas klizhentas left a comment

Choose a reason for hiding this comment

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

@jentfoo after reading this, not clear to me 100% what are you proposing. Are you proposing not to lock out the account after trying recovery token 3 times and failing?

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Dec 11, 2023

Are you proposing not to lock out the account after trying recovery token 3 times and failing?

@klizhentas That is correct. It looks like the account reset mechanisms already takes in inputs that can not be brute forced. So I am recommending we remove this lock out in order to allow accounts that are under a targeted attack to be able to be accessed.

Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

There are a lot of sections in the RFD template that are not included here.

While this is a relatively targeted change and you can probably get away without all of them, I think there are some that are worth discussing.

  • required approvers
  • any gRPC or API changes? Any RPCs that will be deprecated by the change?
  • audit/observability: should we introduce any new metrics to track account recovery attempts?

Comment thread rfd/0158-account-recovery-protections.md Outdated

The [Account Lifecycle RFD](0029-account-lifecycle.md) defines how an account can be recovered after the loss of credentials. However it does not ensure that an account is recoverable under the condition that it is under a targeted attack.

Account authentication can (and should be) locked out after invalid attempts. Because passwords are user supplied, there are real brute force risks that must be considered. However this lockout mechanism can also prevent accounts from being accessible by the legitimate user. We must allow users access to their accounts even under conditions where they are under a targeted attack.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We must allow users access to their accounts even under conditions where they are under a targeted attack.

Brute forcing a password and locking the account is also a targeted attack isn't it? Are you proposing any changes here, or are we okay with not allowing access during this type of targeted attack?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The password reset mechanism unlocks the account from failed password auth failures. Which is a common pattern since theoretically the user likely entered an incorrect password repeatedly before starting the password reset flow.

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Dec 11, 2023

any gRPC or API changes? Any RPCs that will be deprecated by the change?

Please see the linked PR #35325. There is some discussion on how much we should remove from gRPC. I don't feel strongly one way or another, so looking for your guidance

audit/observability: should we introduce any new metrics to track account recovery attempts?

These audit events already exist. I feel like it's more obvious when reviewing the linked PR above.

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Dec 18, 2023

@zmb3 @klizhentas friendly ping on this RFD and the change #35325

The external researcher is asking for updates on this design. I would like to be able to respond if this is something we plan to address.

@zmb3
Copy link
Copy Markdown
Collaborator

zmb3 commented Dec 18, 2023

@jentfoo I'm having trouble approving this because there isn't a lot of detail here. While I understand that you've already made the change, "please see the linked PR" isn't really the spirit of an RFD.

I'd expect that we use the RFD to discuss the scope of the change, and then after we've agreed upon what is in scope and what is not we can review the implementation.

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Dec 18, 2023

@zmb3 I have added the requested sections, let me know if there is anything else I can answer. Thank you!

@jentfoo jentfoo requested a review from strideynet December 22, 2023 16:46

### Fix

Because reset tokens are not user controlled, and neither tokens nor MFA devices are able to be brute forced, this lockout on reset is unnecessary. We should remove this mechanism so that legitimate users who have control over reset tokens or associated MFA can maintain access even under attack conditions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What length are reset tokens at the moment ? Do we need to increase their length if we're removing the 3 attempt limit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The length varies due to us using a combination of words. Each recovery code consists of 8 words. When considering how brute forcible this is, it's tempting to look at the character count (which on average is close to our max input length of 72 characters), but instead we need to recognize the word list is well understood. There are 7775 possible words. which means the probability per guess is (1/7775)^8 (result is 7.5E-32).

This is an extremely low probability, well outside of the possibility of brute forcing. Using a similar length fully random string would technically provide more entropy and brute force resistance, but considering the scale I don't feel that it's a necessary change.

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Dec 29, 2023

I plan to merge this RFD next week, let me know if anyone has any additional feedback. Thank you!

Comment thread rfd/0158-account-recovery-protections.md
@codingllama
Copy link
Copy Markdown
Contributor

I plan to merge this RFD next week, let me know if anyone has any additional feedback. Thank you!

Please make sure you have all the necessary approvals, including product.

I would suggest seeking security approval as well (apart from yourself), so you get an extra pair of eyes there too. Otherwise, happy merging ;)

@jentfoo
Copy link
Copy Markdown
Contributor Author

jentfoo commented Jan 4, 2024

Please make sure you have all the necessary approvals, including product.

My understanding is that after 2 weeks of asking for review, it is assumed to be able to be merged. This was mentioned in the Engineering All Hands some months ago. I still would like any additional feedback, but I have poked people several times now.

@jentfoo jentfoo added this pull request to the merge queue Jan 9, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jan 9, 2024
@jentfoo jentfoo added this pull request to the merge queue Jan 9, 2024
Merged via the queue into master with commit 87db754 Jan 9, 2024
@jentfoo jentfoo deleted the rfd/0158-account-recovery branch January 9, 2024 14:58
jentfoo added a commit that referenced this pull request Jan 23, 2024
This account lockout looks to be unecessary and potentially problematic.  Recovery codes and recovery through MFA are not possible to brute force.

In addition the potential to lockout an account from being able to use a recovery method could result in them being unable to unlock their account from other potential abuse cases (for example an attacker locking the account from failed password attempts).

As discussed in the RFD (#35533) this includes the removal of all the API used for this locking mechanism.
github-merge-queue Bot pushed a commit that referenced this pull request Jan 24, 2024
* Remove account lockout from failed recovery attempts

This account lockout looks to be unecessary and potentially problematic.  Recovery codes and recovery through MFA are not possible to brute force.

In addition the potential to lockout an account from being able to use a recovery method could result in them being unable to unlock their account from other potential abuse cases (for example an attacker locking the account from failed password attempts).

As discussed in the RFD (#35533) this includes the removal of all the API used for this locking mechanism.

* accountrecovery: Update `WithLock` function names

* accountrecovery: Combine verifyRecoveryCode and verifyRecoveryCodeWithRecord into one function

* Further GRPC cleanup after PR feedback

* Apply PR Feedback
jentfoo added a commit that referenced this pull request Jan 24, 2024
* Remove account lockout from failed recovery attempts

This account lockout looks to be unecessary and potentially problematic.  Recovery codes and recovery through MFA are not possible to brute force.

In addition the potential to lockout an account from being able to use a recovery method could result in them being unable to unlock their account from other potential abuse cases (for example an attacker locking the account from failed password attempts).

As discussed in the RFD (#35533) this includes the removal of all the API used for this locking mechanism.

* accountrecovery: Update `WithLock` function names

* accountrecovery: Combine verifyRecoveryCode and verifyRecoveryCodeWithRecord into one function
github-merge-queue Bot pushed a commit that referenced this pull request Jan 25, 2024
* Remove account lockout from failed recovery attempts

This account lockout looks to be unecessary and potentially problematic.  Recovery codes and recovery through MFA are not possible to brute force.

In addition the potential to lockout an account from being able to use a recovery method could result in them being unable to unlock their account from other potential abuse cases (for example an attacker locking the account from failed password attempts).

As discussed in the RFD (#35533) this includes the removal of all the API used for this locking mechanism.

* accountrecovery: Update `WithLock` function names

* accountrecovery: Combine verifyRecoveryCode and verifyRecoveryCodeWithRecord into one function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry rfd Request for Discussion size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants