Repository navigation
feat(auth): recovery follow-ups: no admin grant mid-recovery, trusted mail target, used-only refusal - #190
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
- Nobody is made an administrator while a recovery of the account can still be undone: the admin API refuses, and the CLI grants only with `admin grant --despite-undoable`, once support has confirmed the owner. - A recovery records, and mails its link to, the trusted primary address: the current one, or, while another recovery can be undone, the one the oldest of them recorded. With none, the link is only printed. - Only a used recovery blocks starting another; a new recovery simply replaces an unused link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Support undoes every unused link before granting an administrator's rights back, since confirming the owner says nothing about who holds a link nobody used, and reviews every undoable recovery. While an earlier recovery can be undone, the next link goes to the address it recorded, so changing the primary redirects nothing until it is undone. Tests: a forced recovery's undo restores that address, and a grant goes through once support undid the recovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PiquelChips
force-pushed
the
feat/admin-recovery
branch
from
October 24, 2026 20:11
a8dd652 to
8e3d728
Compare
PiquelChips
force-pushed
the
feat/recovery-follow-ups
branch
from
October 24, 2026 20:11
f7b2e39 to
c81fa9e
Compare
This file contains hidden or 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
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.
Three rules the user approved after #180's fourth review round, kept out of #180 so it can merge as it is. Stacked on #180; it retargets to main once #180 merges.
How
AdminService::grant_administratortakes aWhileUndoableand refuses under the account lock (GrantDuringRecovery).Refuse. The CLI'sadmin grant --despite-undoablepassesProceed, once support has confirmed the owner.AdminService::trusted_primary). Whoever used that earlier recovery can't have chosen it.RecoveryNeedsEmail.--despite-undoable. The CLI's pre-check matches.docs/security/account-recovery.md: R3, R6, L4, T2 and S4 updated, a new A3, and the harassment row.admin grant --despite-undoablemay be used.surfaces.mdmatch.Note on the literal rule (2): an unused link that recorded no address also counts. So a recovery started within 24 hours of an unused, address-less one is only printed, not mailed. A narrower rule would trust only used recoveries' recorded addresses. That's a decision for the user, so it isn't built.
Tests
admin::tests::no_grant_while_a_recovery_can_be_undone: the admin API answers 409, the CLI refuses without the flag, and grants with it.a_forced_recovery_mails_only_the_primary_from_before:administrators_never_see_the_link: an unused link is replaced without the flag.support_undoes_a_hijacked_recoverystill refuses while a used recovery can be undone.Proceed;just db test(205),just test,just lint,just doc,just web check.Review
GPT 6.1 Sol reviewed ecf4b8d and found no implementation problem. Its two P2 policy gaps are fixed in f7b2e39:
admin grant --despite-undoable, and reviews every undoable recovery.Also in f7b2e39:
The comment in
0019_account_recoveries.sqlis left as it is. That migration is #180's, and editing it here would change its checksum.Part of #85.
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol (via T3 Code)
🤖 Generated with Claude Code